import { BaseSchema } from '@adonisjs/lucid/schema' export default class extends BaseSchema { protected tableName = 'replays' async up() { this.schema.createTable(this.tableName, (table) => { table.string('id').primary() table.string('project_id') table.jsonb('trace_ids') table.jsonb('error_ids') table.string('environment').nullable() table.jsonb('tags') table.jsonb('user') table.jsonb('sdk') table.jsonb('os') table.jsonb('browser') table.jsonb('device') table.jsonb('ota_updates') table.boolean('is_archived').nullable() table.jsonb('urls') table.jsonb('clicks') table.integer('count_dead_clicks').nullable() table.integer('count_rage_clicks').nullable() table.integer('count_errors').nullable() table.bigInteger('duration').nullable() table.timestamp('finished_at', { useTz: true }).nullable() table.timestamp('started_at', { useTz: true }).nullable() table.integer('activity').nullable() table.integer('count_urls').nullable() table.string('replay_type') table.integer('count_segments').nullable() table.string('platform').nullable() table.jsonb('releases') table.string('dist').nullable() table.integer('count_warnings').nullable() table.integer('count_infos').nullable() table.boolean('has_viewed') table.timestamp('created_at', { useTz: true }).defaultTo(this.now()) table.timestamp('updated_at', { useTz: true }).defaultTo(this.now()) }) } async down() { this.schema.dropTable(this.tableName) } }