import { MigrationInterface, QueryRunner } from "typeorm";

export class FeatureAnalytics1743609758578 implements MigrationInterface {
    name = 'FeatureAnalytics1743609758578'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`CREATE TABLE \`feature_analytics\` (\`id\` int NOT NULL AUTO_INCREMENT, \`feature_name\` varchar(255) NOT NULL, \`user_id\` varchar(255) NOT NULL, \`user_agent\` varchar(255) NOT NULL, \`country\` varchar(255) NOT NULL, \`metadata\` json NULL, \`timestamp\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), INDEX \`IDX_850c970e3b3c8689217e8f1552\` (\`feature_name\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`DROP INDEX \`IDX_850c970e3b3c8689217e8f1552\` ON \`feature_analytics\``);
        await queryRunner.query(`DROP TABLE \`feature_analytics\``);
    }

}
