Compare commits

..

No commits in common. "77a9c24dab83a576263e706e0fa5e6d2566cfdbd" and "2d7d2835fd7f4d026fea9863b39d6b60150c89c8" have entirely different histories.

5 changed files with 1 additions and 132 deletions

View file

@ -12,8 +12,6 @@ pub fn build(b: *std.Build) !void {
.optimize = optimize, .optimize = optimize,
}); });
exe.use_llvm = true;
// Example dependency: // Example dependency:
// //
const zig_time_dep = b.dependency("zeit", .{}); const zig_time_dep = b.dependency("zeit", .{});

View file

@ -97,7 +97,7 @@ pub const Scrobble = jetquery.Model(
@This(), @This(),
"scrobbles", "scrobbles",
struct { struct {
id: i32, id: i64,
albumsong: i64, albumsong: i64,
datetime: jetquery.DateTime, datetime: jetquery.DateTime,
created_at: jetquery.DateTime, created_at: jetquery.DateTime,
@ -146,66 +146,3 @@ pub const Artistsong = jetquery.Model(
}, },
}, },
); );
pub const Albumrating = jetquery.Model(
@This(),
"albumratings",
struct {
id: i32,
album: i64,
rating: i16,
rating_text: []const u8,
date: jetquery.DateTime,
created_at: jetquery.DateTime,
updated_at: jetquery.DateTime,
},
.{
.relations = .{
.album = jetquery.belongsTo(.Album, .{
.foreign_key = "album",
}),
},
},
);
pub const Artistrating = jetquery.Model(
@This(),
"artistratings",
struct {
id: i32,
artist: i64,
rating: i16,
rating_text: []const u8,
date: jetquery.DateTime,
created_at: jetquery.DateTime,
updated_at: jetquery.DateTime,
},
.{
.relations = .{
.artist = jetquery.belongsTo(.Artist, .{
.foreign_key = "artist",
}),
},
},
);
pub const Songrating = jetquery.Model(
@This(),
"songratings",
struct {
id: i32,
song: i64,
rating: i16,
rating_text: []const u8,
date: jetquery.DateTime,
created_at: jetquery.DateTime,
updated_at: jetquery.DateTime,
},
.{
.relations = .{
.albumsong = jetquery.belongsTo(.Albumsong, .{
.foreign_key = "song",
}),
},
},
);

View file

@ -1,22 +0,0 @@
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", .{});
}

View file

@ -1,22 +0,0 @@
const std = @import("std");
const jetquery = @import("jetquery");
const t = jetquery.schema.table;
pub fn up(repo: anytype) !void {
try repo.createTable(
"albumratings",
&.{
t.primaryKey("id", .{}),
t.column("album", .bigint, .{ .reference = .{ "albums", "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("albumratings", .{});
}

View file

@ -1,22 +0,0 @@
const std = @import("std");
const jetquery = @import("jetquery");
const t = jetquery.schema.table;
pub fn up(repo: anytype) !void {
try repo.createTable(
"artistratings",
&.{
t.primaryKey("id", .{}),
t.column("artist", .bigint, .{ .reference = .{ "artists", "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("artistratings", .{});
}