Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d6c788

Browse files
Add example migrations
1 parent 2742b9c commit 3d6c788

8 files changed

+17
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TABLE Users
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CREATE TABLE Users (
2+
UserId INT64,
3+
Name STRING(40),
4+
Email STRING(83)
5+
) PRIMARY KEY(UserId)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE Users DROP COLUMN city
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE Users ADD COLUMN city STRING(100)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP INDEX UsersEmailIndex
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE UNIQUE INDEX UsersEmailIndex ON Users (Email)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
DROP TABLE Books
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
CREATE TABLE Books (
2+
UserId INT64,
3+
Name STRING(40),
4+
Author STRING(40)
5+
) PRIMARY KEY(UserId, Name),
6+
INTERLEAVE IN PARENT Users ON DELETE CASCADE

0 commit comments

Comments
 (0)