Restart database
It's been 0 days since I've last retsrated the database
This commit is contained in:
parent
010c72252d
commit
473abaf564
13 changed files with 93 additions and 264 deletions
|
|
@ -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", .{});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue