"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const sql_1 = require("drizzle-orm/sql");
const migrations = [
    {
        hash: "20250608-init-trace",
        sql: (0, sql_1.sql) `\
      CREATE TABLE IF NOT EXISTS Trace (
        id TEXT PRIMARY KEY NOT NULL,
        rootId TEXT,
        parentId TEXT,
        name TEXT,
        startTime INTEGER NOT NULL,
        endTime INTEGER NOT NULL,
        status TEXT NOT NULL,
        attributes TEXT NOT NULL,
        links TEXT,
        events TEXT,
        userId TEXT,
        sessionId TEXT
      );
      
      CREATE INDEX IF NOT EXISTS idx_trace_rootId ON Trace (rootId);
      CREATE INDEX IF NOT EXISTS idx_trace_parentId ON Trace (parentId);
    `,
    },
    {
        hash: "20250707_add_componentId",
        sql: (0, sql_1.sql) `\
      ALTER TABLE Trace ADD COLUMN componentId TEXT;

      CREATE INDEX IF NOT EXISTS idx_trace_componentId ON Trace (componentId);
    `,
    },
    {
        hash: "20250707_add_action",
        sql: (0, sql_1.sql) `\
      ALTER TABLE Trace ADD COLUMN action INTEGER;
    `,
    },
];
exports.default = migrations;
