Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcd3998b

Browse files
Step 5. Generate diff scripts
1 parent2ab4346 commitcd3998b

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
CREATETABLEcomments (
2+
idBIGINT GENERATED BY DEFAULTAS IDENTITYNOT NULL,
3+
created_byVARCHAR(255),
4+
created_dateTIMESTAMP WITHOUT TIME ZONE,
5+
last_modified_byVARCHAR(255),
6+
last_modified_dateTIMESTAMP WITHOUT TIME ZONE,
7+
textVARCHAR(255)NOT NULL,
8+
author_idBIGINTNOT NULL,
9+
CONSTRAINT pk_commentsPRIMARY KEY (id)
10+
);
11+
12+
CREATETABLEposts_comments (
13+
comments_idBIGINTNOT NULL,
14+
post_idBIGINTNOT NULL,
15+
CONSTRAINT pk_posts_commentsPRIMARY KEY (comments_id, post_id)
16+
);
17+
18+
ALTERTABLE comments ADDCONSTRAINT FK_COMMENTS_ON_AUTHORFOREIGN KEY (author_id)REFERENCES users (id);
19+
20+
ALTERTABLE posts_comments ADDCONSTRAINT fk_poscom_on_commentFOREIGN KEY (comments_id)REFERENCES comments (id);
21+
22+
ALTERTABLE posts_comments ADDCONSTRAINT fk_poscom_on_postFOREIGN KEY (post_id)REFERENCES posts (id);
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ALTERTABLE users DROP COLUMN fax;
2+
3+
UPDATE
4+
users
5+
SET
6+
email='n/a'
7+
WHERE
8+
email ISNULL;
9+
ALTERTABLE users ALTER COLUMN emailSETNOT NULL;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp