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
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
377 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
This diff is collapsed. Click to expand it.
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