package system

import (
	"kra/pkg/database/migration"

	"gorm.io/gorm"
)

// Migrations returns schema steps owned by the built-in system module.
// Administrators, menus, APIs, and policies are created only by SeedSystem
// during the explicit first-install flow.
func Migrations() []migration.Step {
	return []migration.Step{
		{
			ID: "202608200002_system_schema",
			Migrate: func(db *gorm.DB) error {
				return migration.CreateMissingTables(db,
					&userPO{}, &authorityPO{}, &menuPO{}, &userAuthorityPO{}, &authorityMenuPO{}, &menuParameterPO{},
					&apiPO{}, &ignoredAPIPO{}, &authorityAPIPO{}, &casbinRulePO{}, &menuButtonPO{}, &authorityButtonPO{},
					&departmentPO{}, &positionPO{}, &userDepartmentPO{}, &userPositionPO{}, &authorityDepartmentPO{},
					&dictionaryPO{}, &dictionaryDetailPO{}, &parameterPO{}, &apiTokenPO{}, &jwtBlacklistPO{}, &SecurityConfigPO{},
					&versionPO{}, &exportTemplatePO{}, &exportConditionPO{}, &exportJoinPO{},
					&operationPO{}, &loginLogPO{}, &dataAccessLogPO{}, &errorRecordPO{},
					&taskPO{}, &taskLogPO{}, &mediaPO{}, &categoryPO{}, &uploadSessionPO{}, &uploadChunkPO{},
					&announcementPO{},
				)
			},
		},
	}
}
