-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
295 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
database/spanner/examples/migrations2/1481574547_create_users_table.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE Users; |
15 changes: 15 additions & 0 deletions
15
database/spanner/examples/migrations2/1481574547_create_users_table.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-- Create a table | ||
CREATE TABLE Users ( | ||
UserId INT64, | ||
Name STRING(40), | ||
Email STRING(83) | ||
) PRIMARY KEY(UserId /* even inline comments */); | ||
|
||
CREATE UNIQUE INDEX UsersEmailIndex ON Users (Email); | ||
|
||
-- Comments are okay | ||
|
||
INSERT INTO Users(UserId, Name, Email) | ||
VALUES | ||
(100, "Username", "[email protected]"), | ||
(200, "Username2", "[email protected]"); |
1 change: 1 addition & 0 deletions
1
database/spanner/examples/migrations2/1496539702_add_city_to_users.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE Users DROP COLUMN city; |
1 change: 1 addition & 0 deletions
1
database/spanner/examples/migrations2/1496539702_add_city_to_users.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE Users ADD COLUMN city STRING(100); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.