Last active
April 9, 2020 17:56
-
-
Save dorkness-io/92ee7a14c824b017550bab0adb2a6405 to your computer and use it in GitHub Desktop.
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
/* Let's create a table */ | |
create table some_table ( | |
id integer unique | |
,some_column text | |
,other_column numeric | |
); | |
/* Let's add a column */ | |
alter table some_table | |
add column another_column text; | |
/* Let's rename the table */ | |
alter table some_table | |
rename to test_table; | |
/* Not DDL, but we need a row of data */ | |
insert into test_table values(1,'foo',100); | |
/* Whoops we missed a column! Let's truncate the table and re-create that row */ | |
truncate test_table; | |
insert into test_table values(1,'foo',100,'bar'); | |
/* Ok, we're done, let's drop the table */ | |
drop table test_table; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment