using InvercargillSql.Migrations; namespace ClankerSaddle.Data.Migrations { /** * Web-stack raw terminal log: the daemon's PTY output chunks (GET * /log?since=), appended while a session is active. When a session * has rows here, the terminal view renders the concatenated raw log * instead of the typed entry stream (which older sessions keep * using). The (session_id, seq) pair is unique so poll retries can * never duplicate a chunk. */ public class M0005_RawLog : Migration { public override string name { get { return "Raw log: session_raw_log"; } } public override uint64 serial { get { return 5; } } public override string migration_namespace { get { return "clanker-saddle"; } } public override void up(MigrationBuilder b) { b.create_table("session_raw_log", (t) => { t.column("id") .auto_increment() .primary_key(); t.column("session_id") .not_null() .references("sessions", "id") .indexed(); t.column("seq") .not_null(); t.column("chunk") .not_null(); t.unique("uq_session_raw_log_seq", {"session_id", "seq"}); }); } public override void down(MigrationBuilder b) { b.drop_table("session_raw_log"); } } }