Skip to content

Commit

Permalink
Add proper migrations to Remix CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
jplhomer committed Nov 15, 2024
1 parent 57eb78a commit b02d16e
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 22 deletions.
11 changes: 11 additions & 0 deletions examples/remix-cms/db/migrations/0000_create_users.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Schema } from "superflare";

export default function () {
return Schema.create("users", (table) => {
table.increments("id");
table.string("name").nullable();
table.string("email").unique();
table.string("password");
table.timestamps();
});
}
13 changes: 13 additions & 0 deletions examples/remix-cms/db/migrations/0001_create_articles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Schema } from "superflare";

export default function () {
return Schema.create("articles", (table) => {
table.increments("id");
table.string("title");
table.string("slug").unique();
table.text("content").nullable();
table.integer("userId");
table.string("status");
table.timestamps();
});
}
10 changes: 10 additions & 0 deletions examples/remix-cms/migrations/0000_create_users.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
-- Migration number: 0000 2024-11-15T19:40:10.787Z
-- Autogenerated by Superflare. Do not edit this file directly.
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT,
email TEXT NOT NULL UNIQUE,
password TEXT NOT NULL,
createdAt DATETIME NOT NULL,
updatedAt DATETIME NOT NULL
);
22 changes: 0 additions & 22 deletions examples/remix-cms/migrations/0000_init.sql

This file was deleted.

12 changes: 12 additions & 0 deletions examples/remix-cms/migrations/0001_create_articles.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- Migration number: 0001 2024-11-15T19:40:10.789Z
-- Autogenerated by Superflare. Do not edit this file directly.
CREATE TABLE articles (
id INTEGER PRIMARY KEY,
title TEXT NOT NULL,
slug TEXT NOT NULL UNIQUE,
content TEXT,
userId INTEGER NOT NULL,
status TEXT NOT NULL,
createdAt DATETIME NOT NULL,
updatedAt DATETIME NOT NULL
);

0 comments on commit b02d16e

Please sign in to comment.