Create ratings tables
This commit is contained in:
parent
9c90c683c6
commit
77a9c24dab
4 changed files with 130 additions and 1 deletions
|
|
@ -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", .{});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue