package org.kar.karideo.migration;

import java.util.List;

import org.kar.archidata.migration.MigrationSqlStep;

public class Migration20231015 extends MigrationSqlStep {

	public static final int KARSO_INITIALISATION_ID = 1;

	@Override
	public String getName() {
		return "migration-2023-10-15: refactor creation and update time";
	}

	public Migration20231015() {

	}

	@Override
	public void generateStep() throws Exception {
		for (String elem : List.of("data", "media", "media_link_cover", "season", "season_link_cover", "series", "series_link_cover", "type", "type_link_cover", "user", "userMediaAdvancement")) {
			addAction("""
					ALTER TABLE `""" + elem + """
					`
						RENAME COLUMN `create_date` TO `createdAt`,
						RENAME COLUMN `modify_date` TO `updatedAt`;
					""");
		}
		display();
	}
}
