Add associative tables
You can't run from it
This commit is contained in:
parent
a2aa946b3b
commit
ab01f2e213
5 changed files with 287 additions and 88 deletions
|
|
@ -0,0 +1,20 @@
|
|||
const std = @import("std");
|
||||
const jetquery = @import("jetquery");
|
||||
const t = jetquery.schema.table;
|
||||
|
||||
pub fn up(repo: anytype) !void {
|
||||
try repo.createTable(
|
||||
"Albumsongs",
|
||||
&.{
|
||||
t.primaryKey("id", .{}),
|
||||
t.column("album_id", .integer, .{}),
|
||||
t.column("song_id", .integer, .{}),
|
||||
t.timestamps(.{}),
|
||||
},
|
||||
.{},
|
||||
);
|
||||
}
|
||||
|
||||
pub fn down(repo: anytype) !void {
|
||||
try repo.dropTable("Albumsongs", .{});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue