Create ratings tables

This commit is contained in:
mitteneer 2025-06-22 14:37:10 -04:00
parent 9c90c683c6
commit 77a9c24dab
4 changed files with 130 additions and 1 deletions

View file

@ -0,0 +1,22 @@
const std = @import("std");
const jetquery = @import("jetquery");
const t = jetquery.schema.table;
pub fn up(repo: anytype) !void {
try repo.createTable(
"songratings",
&.{
t.primaryKey("id", .{}),
t.column("song", .bigint, .{ .reference = .{ "albumsongs", "id" } }),
t.column("rating", .smallint, .{}),
t.column("rating_text", .text, .{}),
t.column("date", .datetime, .{}),
t.timestamps(.{}),
},
.{},
);
}
pub fn down(repo: anytype) !void {
try repo.dropTable("songratings", .{});
}