Restart database

It's been 0 days since I've last retsrated the database
This commit is contained in:
mitteneer 2025-02-17 23:05:56 -05:00
parent 010c72252d
commit 473abaf564
13 changed files with 93 additions and 264 deletions

View file

@ -0,0 +1,21 @@
const std = @import("std");
const jetquery = @import("jetquery");
const t = jetquery.schema.table;
pub fn up(repo: anytype) !void {
try repo.createTable(
"scrobbles",
&.{
t.primaryKey("id", .{}),
t.column("song_id", .integer, .{}),
t.column("album_id", .integer, .{ .optional = true }),
t.column("date", .datetime, .{}),
t.timestamps(.{}),
},
.{},
);
}
pub fn down(repo: anytype) !void {
try repo.dropTable("scrobbles", .{});
}