Live game snapshots become version 2 with the clock and each move's time left. On restore the running clock goes on from the start of the turn, so downtime is not charged; version 1 snapshots get a new clock. Saved games keep the initial time (migration 002_clock) and each move's time left.
14 lines
397 B
TypeScript
14 lines
397 B
TypeScript
import { sql as games001 } from "./001_games";
|
|
import { sql as clock002 } from "./002_clock";
|
|
|
|
export interface Migration {
|
|
version: string;
|
|
sql: string;
|
|
}
|
|
|
|
// Applied in this order; never change a migration that has been released, add a new one instead.
|
|
export const migrations: Migration[] = [
|
|
{ version: "001_games", sql: games001 },
|
|
{ version: "002_clock", sql: clock002 },
|
|
];
|