From 1795db69a03b69d933a17f3bd6eaa98d727bce14 Mon Sep 17 00:00:00 2001 From: demian Date: Mon, 22 Feb 2021 10:34:43 +0900 Subject: [PATCH] Relplace migration files with the one which is created by the latest rw version --- .../20201007174432-create-posts/README.md | 45 ------- .../20201007174432-create-posts/schema.prisma | 18 --- .../20201007174432-create-posts/steps.json | 120 ------------------ .../20201007180930-create-contact/README.md | 50 -------- .../schema.prisma | 26 ---- .../20201007180930-create-contact/steps.json | 105 --------------- .../migration.sql | 16 +++ api/db/migrations/migrate.lock | 4 - api/db/migrations/migration_lock.toml | 2 + 9 files changed, 18 insertions(+), 368 deletions(-) delete mode 100644 api/db/migrations/20201007174432-create-posts/README.md delete mode 100644 api/db/migrations/20201007174432-create-posts/schema.prisma delete mode 100644 api/db/migrations/20201007174432-create-posts/steps.json delete mode 100644 api/db/migrations/20201007180930-create-contact/README.md delete mode 100644 api/db/migrations/20201007180930-create-contact/schema.prisma delete mode 100644 api/db/migrations/20201007180930-create-contact/steps.json create mode 100644 api/db/migrations/20210222013102_init_database/migration.sql delete mode 100644 api/db/migrations/migrate.lock create mode 100644 api/db/migrations/migration_lock.toml diff --git a/api/db/migrations/20201007174432-create-posts/README.md b/api/db/migrations/20201007174432-create-posts/README.md deleted file mode 100644 index a706071..0000000 --- a/api/db/migrations/20201007174432-create-posts/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# Migration `20201007174432-create-posts` - -This migration has been generated by Rob Cameron at 10/7/2020, 10:44:32 AM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -CREATE TABLE "Post" ( - "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - "title" TEXT NOT NULL, - "body" TEXT NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP -) -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration ..20201007174432-create-posts ---- datamodel.dml -+++ datamodel.dml -@@ -1,0 +1,18 @@ -+datasource DS { -+ // optionally set multiple providers -+ // example: provider = ["sqlite", "postgresql"] -+ provider = "sqlite" -+ url = "***" -+} -+ -+generator client { -+ provider = "prisma-client-js" -+ binaryTargets = "native" -+} -+ -+model Post { -+ id Int @id @default(autoincrement()) -+ title String -+ body String -+ createdAt DateTime @default(now()) -+} -``` - - diff --git a/api/db/migrations/20201007174432-create-posts/schema.prisma b/api/db/migrations/20201007174432-create-posts/schema.prisma deleted file mode 100644 index 624cbdb..0000000 --- a/api/db/migrations/20201007174432-create-posts/schema.prisma +++ /dev/null @@ -1,18 +0,0 @@ -datasource DS { - // optionally set multiple providers - // example: provider = ["sqlite", "postgresql"] - provider = "sqlite" - url = "***" -} - -generator client { - provider = "prisma-client-js" - binaryTargets = "native" -} - -model Post { - id Int @id @default(autoincrement()) - title String - body String - createdAt DateTime @default(now()) -} diff --git a/api/db/migrations/20201007174432-create-posts/steps.json b/api/db/migrations/20201007174432-create-posts/steps.json deleted file mode 100644 index f2edc88..0000000 --- a/api/db/migrations/20201007174432-create-posts/steps.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateSource", - "source": "DS" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Source", - "source": "DS" - }, - "argument": "provider", - "value": "\"sqlite\"" - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Source", - "source": "DS" - }, - "argument": "url", - "value": "\"***\"" - }, - { - "tag": "CreateModel", - "model": "Post" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "id", - "type": "Int", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Post", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Post", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Post", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "autoincrement()" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "title", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "body", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Post", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Post", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Post", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - } - ] -} \ No newline at end of file diff --git a/api/db/migrations/20201007180930-create-contact/README.md b/api/db/migrations/20201007180930-create-contact/README.md deleted file mode 100644 index 44d90a8..0000000 --- a/api/db/migrations/20201007180930-create-contact/README.md +++ /dev/null @@ -1,50 +0,0 @@ -# Migration `20201007180930-create-contact` - -This migration has been generated by Rob Cameron at 10/7/2020, 11:09:30 AM. -You can check out the [state of the schema](./schema.prisma) after the migration. - -## Database Steps - -```sql -CREATE TABLE "Contact" ( - "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, - "name" TEXT NOT NULL, - "email" TEXT NOT NULL, - "message" TEXT NOT NULL, - "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP -) -``` - -## Changes - -```diff -diff --git schema.prisma schema.prisma -migration 20201007174432-create-posts..20201007180930-create-contact ---- datamodel.dml -+++ datamodel.dml -@@ -1,9 +1,9 @@ - datasource DS { - // optionally set multiple providers - // example: provider = ["sqlite", "postgresql"] - provider = "sqlite" -- url = "***" -+ url = "***" - } - generator client { - provider = "prisma-client-js" -@@ -15,4 +15,12 @@ - title String - body String - createdAt DateTime @default(now()) - } -+ -+model Contact { -+ id Int @id @default(autoincrement()) -+ name String -+ email String -+ message String -+ createdAt DateTime @default(now()) -+} -``` - - diff --git a/api/db/migrations/20201007180930-create-contact/schema.prisma b/api/db/migrations/20201007180930-create-contact/schema.prisma deleted file mode 100644 index f983e1e..0000000 --- a/api/db/migrations/20201007180930-create-contact/schema.prisma +++ /dev/null @@ -1,26 +0,0 @@ -datasource DS { - // optionally set multiple providers - // example: provider = ["sqlite", "postgresql"] - provider = "sqlite" - url = "***" -} - -generator client { - provider = "prisma-client-js" - binaryTargets = "native" -} - -model Post { - id Int @id @default(autoincrement()) - title String - body String - createdAt DateTime @default(now()) -} - -model Contact { - id Int @id @default(autoincrement()) - name String - email String - message String - createdAt DateTime @default(now()) -} diff --git a/api/db/migrations/20201007180930-create-contact/steps.json b/api/db/migrations/20201007180930-create-contact/steps.json deleted file mode 100644 index 0ca4b72..0000000 --- a/api/db/migrations/20201007180930-create-contact/steps.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "version": "0.3.14-fixed", - "steps": [ - { - "tag": "CreateModel", - "model": "Contact" - }, - { - "tag": "CreateField", - "model": "Contact", - "field": "id", - "type": "Int", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Contact", - "field": "id" - }, - "directive": "id" - } - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Contact", - "field": "id" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Contact", - "field": "id" - }, - "directive": "default" - }, - "argument": "", - "value": "autoincrement()" - }, - { - "tag": "CreateField", - "model": "Contact", - "field": "name", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Contact", - "field": "email", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Contact", - "field": "message", - "type": "String", - "arity": "Required" - }, - { - "tag": "CreateField", - "model": "Contact", - "field": "createdAt", - "type": "DateTime", - "arity": "Required" - }, - { - "tag": "CreateDirective", - "location": { - "path": { - "tag": "Field", - "model": "Contact", - "field": "createdAt" - }, - "directive": "default" - } - }, - { - "tag": "CreateArgument", - "location": { - "tag": "Directive", - "path": { - "tag": "Field", - "model": "Contact", - "field": "createdAt" - }, - "directive": "default" - }, - "argument": "", - "value": "now()" - } - ] -} \ No newline at end of file diff --git a/api/db/migrations/20210222013102_init_database/migration.sql b/api/db/migrations/20210222013102_init_database/migration.sql new file mode 100644 index 0000000..5900f7e --- /dev/null +++ b/api/db/migrations/20210222013102_init_database/migration.sql @@ -0,0 +1,16 @@ +-- CreateTable +CREATE TABLE "Post" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "title" TEXT NOT NULL, + "body" TEXT NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP +); + +-- CreateTable +CREATE TABLE "Contact" ( + "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, + "name" TEXT NOT NULL, + "email" TEXT NOT NULL, + "message" TEXT NOT NULL, + "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP +); diff --git a/api/db/migrations/migrate.lock b/api/db/migrations/migrate.lock deleted file mode 100644 index 7d72c0b..0000000 --- a/api/db/migrations/migrate.lock +++ /dev/null @@ -1,4 +0,0 @@ -# Prisma Migrate lockfile v1 - -20201007174432-create-posts -20201007180930-create-contact \ No newline at end of file diff --git a/api/db/migrations/migration_lock.toml b/api/db/migrations/migration_lock.toml new file mode 100644 index 0000000..963afcc --- /dev/null +++ b/api/db/migrations/migration_lock.toml @@ -0,0 +1,2 @@ +# Please do not edit this file manually +provider = "sqlite" \ No newline at end of file