Make rating data optional
Use HTML to enfore at least one of the two fields has a value, but I don't want to require both
This commit is contained in:
parent
b7e625dd98
commit
996022fe5f
4 changed files with 16 additions and 22 deletions
|
|
@ -7,9 +7,9 @@ pub fn up(repo: anytype) !void {
|
|||
"songratings",
|
||||
&.{
|
||||
t.primaryKey("id", .{}),
|
||||
t.column("song", .bigint, .{ .reference = .{ "albumsongs", "id" } }),
|
||||
t.column("rating", .smallint, .{}),
|
||||
t.column("rating_text", .text, .{}),
|
||||
t.column("song", .bigint, .{ .reference = .{ "songs", "id" } }),
|
||||
t.column("rating", .smallint, .{ .optional = true }),
|
||||
t.column("rating_text", .text, .{ .optional = true }),
|
||||
t.column("date", .datetime, .{}),
|
||||
t.timestamps(.{}),
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue