diff --git a/src/app/database/migrations/2025-05-04_05-05-24_create_blogs.zig b/src/app/database/migrations/2025-05-04_05-05-24_create_blogs.zig new file mode 100644 index 0000000..c9e2d5d --- /dev/null +++ b/src/app/database/migrations/2025-05-04_05-05-24_create_blogs.zig @@ -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( + "blogs", + &.{ + t.primaryKey("id", .{}), + t.column("title", .string, .{}), + t.column("content", .text, .{ .optional = true }), + t.timestamps(.{}), + }, + .{}, + ); +} + +pub fn down(repo: anytype) !void { + try repo.dropTable("blogs", .{}); +}