Created
October 5, 2015 07:04
-
-
Save fiftin/18221054c7777e1f1207 to your computer and use it in GitHub Desktop.
Revisions
-
etlds revised this gist
Jul 7, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -21,6 +21,7 @@ 7. Import $ rm db/development.sqlite3 $ rake db:migrate $ sqlite3 db/development.sqlite3 > delete from schema_migrations; > .read dump.sql -
etlds revised this gist
Jun 22, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -23,4 +23,5 @@ $ rm db/development.sqlite3 $ sqlite3 db/development.sqlite3 > delete from schema_migrations; > .read dump.sql > .exit -
etlds revised this gist
Jun 22, 2015 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -20,6 +20,7 @@ 6. Add BEGIN; and END; to wrap the whole thing as a trasaction 7. Import $ rm db/development.sqlite3 $ sqlite3 db/development.sqlite3 > delete from schema_migrations; > .read dump.sql -
etlds renamed this gist
Jun 8, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
etlds created this gist
Jun 8, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ 1. Dump the data only sql to file $ pg_dump --data-only --inserts YOUR_DB_NAME > dump.sql 2. scp to local 3. Remove the SET statements at the top such as: SET statement_timeout = 0; SET client_encoding = 'SQL_ASCII'; 4. Remove the setval sequence queries such as: SELECT pg_catalog.setval('MY_OBJECT_id_seq', 10, true); 5. Replace true => ‘t’ and false => ‘f’ -- These: INSERT INTO table_name VALUES (1, true, false); -- Should be replace to: INSERT INTO table_name VALUES (1, 't', 'f'); 6. Add BEGIN; and END; to wrap the whole thing as a trasaction 7. Import $ sqlite3 db/development.sqlite3 > delete from schema_migrations; > .read dump.sql