Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-04-26 00:40:37 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1dafd2d12b5f426d45823ee387f9f2e8127415bb
1dafd2d1
1 parent
ac4daada
remove unused files
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
929 deletions
back/prisma/migrations/20200419160117-init/README.md
back/prisma/migrations/20200419160117-init/schema.prisma
back/prisma/migrations/20200419160117-init/steps.json
back/prisma/migrations/20200424124259-init/README.md
back/prisma/migrations/20200424124259-init/schema.prisma
back/prisma/migrations/20200424124259-init/steps.json
back/prisma/migrations/migrate.lock
back/prisma/migrations/20200419160117-init/README.md
deleted
100644 → 0
View file @
ac4daad
# Migration `20200419160117-init`
This migration has been generated by sdy at 4/19/2020, 4:01:17 PM.
You can check out the
[
state of the schema
](
./schema.prisma
)
after the migration.
## Database Steps
```
sql
CREATE
TABLE
`chat_schema`
.
`User`
(
`avatarUrl`
varchar
(
191
)
,
`bio`
varchar
(
191
)
,
`createdAt`
datetime
DEFAULT
CURRENT_TIMESTAMP
,
`email`
varchar
(
191
)
NOT
NULL
,
`id`
int
NOT
NULL
AUTO_INCREMENT
,
`loginSecret`
varchar
(
191
)
,
`name`
varchar
(
191
)
NOT
NULL
,
`password`
varchar
(
191
)
NOT
NULL
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`Room`
(
`id`
int
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`Category`
(
`id`
int
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
191
)
DEFAULT
''
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`Message`
(
`id`
int
NOT
NULL
AUTO_INCREMENT
,
`senderId`
int
NOT
NULL
,
`text`
varchar
(
191
)
DEFAULT
''
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`_RoomToUser`
(
`A`
int
NOT
NULL
,
`B`
int
NOT
NULL
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`_CategoryToRoom`
(
`A`
int
NOT
NULL
,
`B`
int
NOT
NULL
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
UNIQUE
INDEX
`User.email`
ON
`chat_schema`
.
`User`
(
`email`
)
CREATE
UNIQUE
INDEX
`_RoomToUser_AB_unique`
ON
`chat_schema`
.
`_RoomToUser`
(
`A`
,
`B`
)
CREATE
INDEX
`_RoomToUser_B_index`
ON
`chat_schema`
.
`_RoomToUser`
(
`B`
)
CREATE
UNIQUE
INDEX
`_CategoryToRoom_AB_unique`
ON
`chat_schema`
.
`_CategoryToRoom`
(
`A`
,
`B`
)
CREATE
INDEX
`_CategoryToRoom_B_index`
ON
`chat_schema`
.
`_CategoryToRoom`
(
`B`
)
ALTER
TABLE
`chat_schema`
.
`Message`
ADD
FOREIGN
KEY
(
`senderId`
)
REFERENCES
`chat_schema`
.
`User`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
ALTER
TABLE
`chat_schema`
.
`_RoomToUser`
ADD
FOREIGN
KEY
(
`A`
)
REFERENCES
`chat_schema`
.
`Room`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
ALTER
TABLE
`chat_schema`
.
`_RoomToUser`
ADD
FOREIGN
KEY
(
`B`
)
REFERENCES
`chat_schema`
.
`User`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
ALTER
TABLE
`chat_schema`
.
`_CategoryToRoom`
ADD
FOREIGN
KEY
(
`A`
)
REFERENCES
`chat_schema`
.
`Category`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
ALTER
TABLE
`chat_schema`
.
`_CategoryToRoom`
ADD
FOREIGN
KEY
(
`B`
)
REFERENCES
`chat_schema`
.
`Room`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
DROP
TABLE
`chat_schema`
.
`_migration`
;
DROP
TABLE
`chat_schema`
.
`test`
;
```
## Changes
```
diff
diff --git schema.prisma schema.prisma
migration ..20200419160117-init
--- datamodel.dml
+++ datamodel.dml
@@ -1,0 +1,41 @@
+generator client {
+ provider = "prisma-client-js"
+ binaryTargets = ["native", "debian-openssl-1.1.x"]
+}
+
+datasource db {
+ provider = "mysql"
+ url = env("DATABASE_URL")
+}
+
+model User {
+ id Int @default(autoincrement()) @id
+ avatarUrl String?
+ email String @unique
+ password String
+ name String
+ loginSecret String?
+ bio String?
+ rooms Room[] @relation(references: [id])
+ messages Message[]
+ createdAt DateTime? @default(now())
+}
+
+model Room {
+ id Int @default(autoincrement()) @id
+ participants User[] @relation(references: [id])
+ categories Category[] @relation(references: [id])
+}
+
+model Category {
+ id Int @default(autoincrement()) @id
+ name String? @default("")
+ rooms Room[] @relation(references: [id])
+}
+
+model Message {
+ id Int @default(autoincrement()) @id
+ text String? @default("")
+ sender User @relation(fields: [senderId], references: [id])
+ senderId Int
+}
```
back/prisma/migrations/20200419160117-init/schema.prisma
deleted
100644 → 0
View file @
ac4daad
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-1.1.x"]
}
datasource db {
provider = "mysql"
url = "***"
}
model User {
id Int @default(autoincrement()) @id
avatarUrl String?
email String @unique
password String
name String
loginSecret String?
bio String?
rooms Room[] @relation(references: [id])
messages Message[]
createdAt DateTime? @default(now())
}
model Room {
id Int @default(autoincrement()) @id
participants User[] @relation(references: [id])
categories Category[] @relation(references: [id])
}
model Category {
id Int @default(autoincrement()) @id
name String? @default("")
rooms Room[] @relation(references: [id])
}
model Message {
id Int @default(autoincrement()) @id
text String? @default("")
sender User @relation(fields: [senderId], references: [id])
senderId Int
}
\ No newline at end of file
back/prisma/migrations/20200419160117-init/steps.json
deleted
100644 → 0
View file @
ac4daad
{
"version"
:
"0.3.14-fixed"
,
"steps"
:
[
{
"tag"
:
"CreateSource"
,
"source"
:
"db"
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Source"
,
"source"
:
"db"
},
"argument"
:
"provider"
,
"value"
:
"
\"
mysql
\"
"
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Source"
,
"source"
:
"db"
},
"argument"
:
"url"
,
"value"
:
"env(
\"
DATABASE_URL
\"
)"
},
{
"tag"
:
"CreateModel"
,
"model"
:
"User"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"id"
,
"type"
:
"Int"
,
"arity"
:
"Required"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"User"
,
"field"
:
"id"
},
"directive"
:
"default"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"User"
,
"field"
:
"id"
},
"directive"
:
"default"
},
"argument"
:
""
,
"value"
:
"autoincrement()"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"User"
,
"field"
:
"id"
},
"directive"
:
"id"
}
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"avatarUrl"
,
"type"
:
"String"
,
"arity"
:
"Optional"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"email"
,
"type"
:
"String"
,
"arity"
:
"Required"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"User"
,
"field"
:
"email"
},
"directive"
:
"unique"
}
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"password"
,
"type"
:
"String"
,
"arity"
:
"Required"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"name"
,
"type"
:
"String"
,
"arity"
:
"Required"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"loginSecret"
,
"type"
:
"String"
,
"arity"
:
"Optional"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"bio"
,
"type"
:
"String"
,
"arity"
:
"Optional"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"rooms"
,
"type"
:
"Room"
,
"arity"
:
"List"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"User"
,
"field"
:
"rooms"
},
"directive"
:
"relation"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"User"
,
"field"
:
"rooms"
},
"directive"
:
"relation"
},
"argument"
:
"references"
,
"value"
:
"[id]"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"messages"
,
"type"
:
"Message"
,
"arity"
:
"List"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"createdAt"
,
"type"
:
"DateTime"
,
"arity"
:
"Optional"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"User"
,
"field"
:
"createdAt"
},
"directive"
:
"default"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"User"
,
"field"
:
"createdAt"
},
"directive"
:
"default"
},
"argument"
:
""
,
"value"
:
"now()"
},
{
"tag"
:
"CreateModel"
,
"model"
:
"Room"
},
{
"tag"
:
"CreateField"
,
"model"
:
"Room"
,
"field"
:
"id"
,
"type"
:
"Int"
,
"arity"
:
"Required"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Room"
,
"field"
:
"id"
},
"directive"
:
"default"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Room"
,
"field"
:
"id"
},
"directive"
:
"default"
},
"argument"
:
""
,
"value"
:
"autoincrement()"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Room"
,
"field"
:
"id"
},
"directive"
:
"id"
}
},
{
"tag"
:
"CreateField"
,
"model"
:
"Room"
,
"field"
:
"participants"
,
"type"
:
"User"
,
"arity"
:
"List"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Room"
,
"field"
:
"participants"
},
"directive"
:
"relation"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Room"
,
"field"
:
"participants"
},
"directive"
:
"relation"
},
"argument"
:
"references"
,
"value"
:
"[id]"
},
{
"tag"
:
"CreateField"
,
"model"
:
"Room"
,
"field"
:
"categories"
,
"type"
:
"Category"
,
"arity"
:
"List"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Room"
,
"field"
:
"categories"
},
"directive"
:
"relation"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Room"
,
"field"
:
"categories"
},
"directive"
:
"relation"
},
"argument"
:
"references"
,
"value"
:
"[id]"
},
{
"tag"
:
"CreateModel"
,
"model"
:
"Category"
},
{
"tag"
:
"CreateField"
,
"model"
:
"Category"
,
"field"
:
"id"
,
"type"
:
"Int"
,
"arity"
:
"Required"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Category"
,
"field"
:
"id"
},
"directive"
:
"default"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Category"
,
"field"
:
"id"
},
"directive"
:
"default"
},
"argument"
:
""
,
"value"
:
"autoincrement()"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Category"
,
"field"
:
"id"
},
"directive"
:
"id"
}
},
{
"tag"
:
"CreateField"
,
"model"
:
"Category"
,
"field"
:
"name"
,
"type"
:
"String"
,
"arity"
:
"Optional"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Category"
,
"field"
:
"name"
},
"directive"
:
"default"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Category"
,
"field"
:
"name"
},
"directive"
:
"default"
},
"argument"
:
""
,
"value"
:
"
\"\"
"
},
{
"tag"
:
"CreateField"
,
"model"
:
"Category"
,
"field"
:
"rooms"
,
"type"
:
"Room"
,
"arity"
:
"List"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Category"
,
"field"
:
"rooms"
},
"directive"
:
"relation"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Category"
,
"field"
:
"rooms"
},
"directive"
:
"relation"
},
"argument"
:
"references"
,
"value"
:
"[id]"
},
{
"tag"
:
"CreateModel"
,
"model"
:
"Message"
},
{
"tag"
:
"CreateField"
,
"model"
:
"Message"
,
"field"
:
"id"
,
"type"
:
"Int"
,
"arity"
:
"Required"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Message"
,
"field"
:
"id"
},
"directive"
:
"default"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Message"
,
"field"
:
"id"
},
"directive"
:
"default"
},
"argument"
:
""
,
"value"
:
"autoincrement()"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Message"
,
"field"
:
"id"
},
"directive"
:
"id"
}
},
{
"tag"
:
"CreateField"
,
"model"
:
"Message"
,
"field"
:
"text"
,
"type"
:
"String"
,
"arity"
:
"Optional"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Message"
,
"field"
:
"text"
},
"directive"
:
"default"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Message"
,
"field"
:
"text"
},
"directive"
:
"default"
},
"argument"
:
""
,
"value"
:
"
\"\"
"
},
{
"tag"
:
"CreateField"
,
"model"
:
"Message"
,
"field"
:
"sender"
,
"type"
:
"User"
,
"arity"
:
"Required"
},
{
"tag"
:
"CreateDirective"
,
"location"
:
{
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Message"
,
"field"
:
"sender"
},
"directive"
:
"relation"
}
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Message"
,
"field"
:
"sender"
},
"directive"
:
"relation"
},
"argument"
:
"fields"
,
"value"
:
"[senderId]"
},
{
"tag"
:
"CreateArgument"
,
"location"
:
{
"tag"
:
"Directive"
,
"path"
:
{
"tag"
:
"Field"
,
"model"
:
"Message"
,
"field"
:
"sender"
},
"directive"
:
"relation"
},
"argument"
:
"references"
,
"value"
:
"[id]"
},
{
"tag"
:
"CreateField"
,
"model"
:
"Message"
,
"field"
:
"senderId"
,
"type"
:
"Int"
,
"arity"
:
"Required"
}
]
}
\ No newline at end of file
back/prisma/migrations/20200424124259-init/README.md
deleted
100644 → 0
View file @
ac4daad
# Migration `20200424124259-init`
This migration has been generated by sdy at 4/24/2020, 12:42:59 PM.
You can check out the
[
state of the schema
](
./schema.prisma
)
after the migration.
## Database Steps
```
sql
CREATE
TABLE
`chat_schema`
.
`User`
(
`avatarUrl`
varchar
(
191
)
,
`bio`
varchar
(
191
)
,
`createdAt`
datetime
DEFAULT
CURRENT_TIMESTAMP
,
`email`
varchar
(
191
)
NOT
NULL
,
`emailSecret`
varchar
(
191
)
,
`id`
int
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
191
)
NOT
NULL
,
`password`
varchar
(
191
)
NOT
NULL
,
`phoneNumber`
int
,
`phoneSecret`
varchar
(
191
)
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`Room`
(
`id`
int
NOT
NULL
AUTO_INCREMENT
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`Category`
(
`id`
int
NOT
NULL
AUTO_INCREMENT
,
`name`
varchar
(
191
)
DEFAULT
''
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`Message`
(
`id`
int
NOT
NULL
AUTO_INCREMENT
,
`senderId`
int
NOT
NULL
,
`text`
varchar
(
191
)
DEFAULT
''
,
PRIMARY
KEY
(
`id`
)
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`_RoomToUser`
(
`A`
int
NOT
NULL
,
`B`
int
NOT
NULL
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
TABLE
`chat_schema`
.
`_CategoryToRoom`
(
`A`
int
NOT
NULL
,
`B`
int
NOT
NULL
)
DEFAULT
CHARACTER
SET
utf8mb4
COLLATE
utf8mb4_unicode_ci
CREATE
UNIQUE
INDEX
`User.email`
ON
`chat_schema`
.
`User`
(
`email`
)
CREATE
UNIQUE
INDEX
`_RoomToUser_AB_unique`
ON
`chat_schema`
.
`_RoomToUser`
(
`A`
,
`B`
)
CREATE
INDEX
`_RoomToUser_B_index`
ON
`chat_schema`
.
`_RoomToUser`
(
`B`
)
CREATE
UNIQUE
INDEX
`_CategoryToRoom_AB_unique`
ON
`chat_schema`
.
`_CategoryToRoom`
(
`A`
,
`B`
)
CREATE
INDEX
`_CategoryToRoom_B_index`
ON
`chat_schema`
.
`_CategoryToRoom`
(
`B`
)
ALTER
TABLE
`chat_schema`
.
`Message`
ADD
FOREIGN
KEY
(
`senderId`
)
REFERENCES
`chat_schema`
.
`User`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
ALTER
TABLE
`chat_schema`
.
`_RoomToUser`
ADD
FOREIGN
KEY
(
`A`
)
REFERENCES
`chat_schema`
.
`Room`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
ALTER
TABLE
`chat_schema`
.
`_RoomToUser`
ADD
FOREIGN
KEY
(
`B`
)
REFERENCES
`chat_schema`
.
`User`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
ALTER
TABLE
`chat_schema`
.
`_CategoryToRoom`
ADD
FOREIGN
KEY
(
`A`
)
REFERENCES
`chat_schema`
.
`Category`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
ALTER
TABLE
`chat_schema`
.
`_CategoryToRoom`
ADD
FOREIGN
KEY
(
`B`
)
REFERENCES
`chat_schema`
.
`Room`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
DROP
TABLE
`chat_schema`
.
`_categorytoroom`
;
DROP
TABLE
`chat_schema`
.
`_migration`
;
DROP
TABLE
`chat_schema`
.
`_roomtouser`
;
DROP
TABLE
`chat_schema`
.
`category`
;
DROP
TABLE
`chat_schema`
.
`message`
;
DROP
TABLE
`chat_schema`
.
`room`
;
DROP
TABLE
`chat_schema`
.
`test`
;
DROP
TABLE
`chat_schema`
.
`user`
;
```
## Changes
```
diff
diff --git schema.prisma schema.prisma
migration 20200419160117-init..20200424124259-init
--- datamodel.dml
+++ datamodel.dml
@@ -4,18 +4,20 @@
}
datasource db {
provider = "mysql"
- url = "***"
+ url = env("DATABASE_URL")
}
model User {
id Int @default(autoincrement()) @id
avatarUrl String?
email String @unique
password String
name String
- loginSecret String?
+ phoneNumber Int?
+ emailSecret String?
+ phoneSecret String?
bio String?
rooms Room[] @relation(references: [id])
messages Message[]
createdAt DateTime? @default(now())
```
back/prisma/migrations/20200424124259-init/schema.prisma
deleted
100644 → 0
View file @
ac4daad
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-1.1.x"]
}
datasource db {
provider = "mysql"
url = "***"
}
model User {
id Int @default(autoincrement()) @id
avatarUrl String?
email String @unique
password String
name String
phoneNumber Int?
emailSecret String?
phoneSecret String?
bio String?
rooms Room[] @relation(references: [id])
messages Message[]
createdAt DateTime? @default(now())
}
model Room {
id Int @default(autoincrement()) @id
participants User[] @relation(references: [id])
categories Category[] @relation(references: [id])
}
model Category {
id Int @default(autoincrement()) @id
name String? @default("")
rooms Room[] @relation(references: [id])
}
model Message {
id Int @default(autoincrement()) @id
text String? @default("")
sender User @relation(fields: [senderId], references: [id])
senderId Int
}
\ No newline at end of file
back/prisma/migrations/20200424124259-init/steps.json
deleted
100644 → 0
View file @
ac4daad
{
"version"
:
"0.3.14-fixed"
,
"steps"
:
[
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"phoneNumber"
,
"type"
:
"Int"
,
"arity"
:
"Optional"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"emailSecret"
,
"type"
:
"String"
,
"arity"
:
"Optional"
},
{
"tag"
:
"CreateField"
,
"model"
:
"User"
,
"field"
:
"phoneSecret"
,
"type"
:
"String"
,
"arity"
:
"Optional"
},
{
"tag"
:
"DeleteField"
,
"model"
:
"User"
,
"field"
:
"loginSecret"
}
]
}
\ No newline at end of file
back/prisma/migrations/migrate.lock
deleted
100644 → 0
View file @
ac4daad
# IF THERE'S A GIT CONFLICT IN THIS FILE, DON'T SOLVE IT MANUALLY!
# INSTEAD EXECUTE `prisma migrate fix`
# Prisma Migrate lockfile v1
# Read more about conflict resolution here: TODO
20200419160117-init
20200424124259-init
\ No newline at end of file
Please
register
or
login
to post a comment