database-migration

Migrate postgres dump to RDS

六眼飞鱼酱① 提交于 2021-02-07 08:04:27
问题 I have a Django postgres db (v9.3.10) running on digital ocean and am trying to migrate it over to Amazon RDS (postgres v 9.4.5). The RDS is a db.m3.xlarge instance with 300GB. I've dumped the Digital Ocean db with: sudo -u postgres pg_dump -Fc -o -f /home/<user>/db.sql <dbname> And now I'm trying to migrate it over with: pg_restore -h <RDS endpoint> --clean -Fc -v -d <dbname> -U <RDS master user> /home/<user>/db.sql The only error I see is: pg_restore: [archiver (db)] Error from TOC entry

Laravel 5.5 Consolidate migrations w/ production database

廉价感情. 提交于 2021-02-06 11:05:08
问题 Hopefully, I can explain this well. I have a Laravel application that has been in production for a minute. So, I have a bunch of migration files with a lot of changes. I would like to consolidate these migration files without losing the database. The way I think this would work: Get all production tables migrated to the desired state. Consolidate all the migration files into the minimum number of files needed. Clear the migrations table. Either run migrations or populate the migrations table.

Laravel 5.5 Consolidate migrations w/ production database

两盒软妹~` 提交于 2021-02-06 11:02:02
问题 Hopefully, I can explain this well. I have a Laravel application that has been in production for a minute. So, I have a bunch of migration files with a lot of changes. I would like to consolidate these migration files without losing the database. The way I think this would work: Get all production tables migrated to the desired state. Consolidate all the migration files into the minimum number of files needed. Clear the migrations table. Either run migrations or populate the migrations table.

Laravel 5.5 Consolidate migrations w/ production database

℡╲_俬逩灬. 提交于 2021-02-06 11:01:46
问题 Hopefully, I can explain this well. I have a Laravel application that has been in production for a minute. So, I have a bunch of migration files with a lot of changes. I would like to consolidate these migration files without losing the database. The way I think this would work: Get all production tables migrated to the desired state. Consolidate all the migration files into the minimum number of files needed. Clear the migrations table. Either run migrations or populate the migrations table.

Laravel 5.5 Consolidate migrations w/ production database

我只是一个虾纸丫 提交于 2021-02-06 11:01:43
问题 Hopefully, I can explain this well. I have a Laravel application that has been in production for a minute. So, I have a bunch of migration files with a lot of changes. I would like to consolidate these migration files without losing the database. The way I think this would work: Get all production tables migrated to the desired state. Consolidate all the migration files into the minimum number of files needed. Clear the migrations table. Either run migrations or populate the migrations table.

Laravel 5.5 Consolidate migrations w/ production database

[亡魂溺海] 提交于 2021-02-06 11:01:07
问题 Hopefully, I can explain this well. I have a Laravel application that has been in production for a minute. So, I have a bunch of migration files with a lot of changes. I would like to consolidate these migration files without losing the database. The way I think this would work: Get all production tables migrated to the desired state. Consolidate all the migration files into the minimum number of files needed. Clear the migrations table. Either run migrations or populate the migrations table.

Laravel 3 Schema Table Column Collation

柔情痞子 提交于 2021-02-06 09:34:49
问题 I'm learning laravel, and I'm stuck on a simple process. I want the tables to be generated as UTF-8 but varchar and text fields are like latin-1. Schema section in guide did not help at all. I found this GitHub entry but it does not work neither (throws me errors). I have a schema like this: <?php class Create_Authors_Table { /** * Make changes to the database. * * @return void */ public function up() { Schema::create('authors',function($table){ //$table->charset('utf8'); //does not work //

How to rename two tables in one atomic operation in MySQL

自作多情 提交于 2021-02-04 13:08:17
问题 I need to rename two tables in one atomic operation so that user will never be able to see the database in its intermediate state. I'm using MySQL and noticed that this case is perfectly described in the documentation: 13.3.3 Statements That Cause an Implicit Commit The statements listed in this section (and any synonyms for them) implicitly end any transaction active in the current session, as if you had done a COMMIT before executing the statement [...] Data definition language (DDL)

How to rename two tables in one atomic operation in MySQL

我怕爱的太早我们不能终老 提交于 2021-02-04 13:07:35
问题 I need to rename two tables in one atomic operation so that user will never be able to see the database in its intermediate state. I'm using MySQL and noticed that this case is perfectly described in the documentation: 13.3.3 Statements That Cause an Implicit Commit The statements listed in this section (and any synonyms for them) implicitly end any transaction active in the current session, as if you had done a COMMIT before executing the statement [...] Data definition language (DDL)

Merge in postgres

与世无争的帅哥 提交于 2021-01-29 19:07:04
问题 Am trying to convert below oracle query to postgres, MERGE INTO table1 g USING (SELECT distinct g.CDD , d.SGR from table2 g, table3 d where g.IDF = d.IDF) f ON (g.SGR = f.SGR and g.CDD = f.CDD) WHEN NOT MATCHED THEN INSERT (SGR, CDD) VALUES (f.SGR, f.CDD); I made changes as below compatible to postgres: WITH f AS ( SELECT distinct g.CDD , d.SGR from table2 g, table3 d where g.IDF = d.IDF ), upd AS ( update table1 g set SGR = f.SGR , CDD = f.CDD FROM f where g.SGR = f.SGR and g.CDD = f.CDD