import type { QueryInterface } from 'sequelize';
import { INITIAL_SCHEMA_UP, INITIAL_SCHEMA_DOWN } from '@/db/initial-schema';

/**
 * Initial schema. The DDL is a snapshot generated from the Sequelize models
 * (see `@/db/initial-schema`). It mirrors exactly what `sequelize.sync()` would
 * produce, so the models stay the source of truth while the schema is now
 * created and tracked through migrations.
 */
export default {
  up: async (queryInterface: QueryInterface) => {
    await queryInterface.sequelize.query(INITIAL_SCHEMA_UP);
  },
  down: async (queryInterface: QueryInterface) => {
    await queryInterface.sequelize.query(INITIAL_SCHEMA_DOWN);
  },
};
