Skip to content

Commit

Permalink
Migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Mar 23, 2024
1 parent 3a2c23a commit 3308e3c
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ out/
!.env.example

# DB
prisma/*.db
prisma/*.db*
34 changes: 34 additions & 0 deletions prisma/migrations/20240323035507_initial/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-- CreateTable
CREATE TABLE "Byte" (
"id" TEXT NOT NULL PRIMARY KEY,
"slug" TEXT NOT NULL,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"title" TEXT NOT NULL,
"description" TEXT NOT NULL,
"content" BLOB NOT NULL
);

-- CreateTable
CREATE TABLE "Tag" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"name" TEXT NOT NULL
);

-- CreateTable
CREATE TABLE "_ByteToTag" (
"A" TEXT NOT NULL,
"B" INTEGER NOT NULL
);

-- CreateIndex
CREATE UNIQUE INDEX "Byte_slug_key" ON "Byte"("slug");

-- CreateIndex
CREATE UNIQUE INDEX "Tag_name_key" ON "Tag"("name");

-- CreateIndex
CREATE UNIQUE INDEX "_ByteToTag_AB_unique" ON "_ByteToTag"("A", "B");

-- CreateIndex
CREATE INDEX "_ByteToTag_B_index" ON "_ByteToTag"("B");
3 changes: 3 additions & 0 deletions prisma/migrations/migration_lock.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "sqlite"

0 comments on commit 3308e3c

Please sign in to comment.