database-migration

Xamarin Forms, Sqlite, EF Core 3, migrations, and lot of confussion

孤街醉人 提交于 2021-02-18 07:56:25
问题 I have a Xamarin Forms app that I have switched from using only restful API to using local SQLite DB, that will sync using this Dotmim.Sync - DB Sync'ing Framework (which is great!). I am using EF Core 3 in the Xamarin forms project to interact with SQLite. My questions are around running migrations or just database updates on SQLite. I have read several blogs and forums about different approaches, but they all are several years old, from EF Core 1 to EF Core 2, and lots of work around. https

rails database migrations using transactions

 ̄綄美尐妖づ 提交于 2021-02-16 16:27:43
问题 I'm just learning Rails and have begun the section on database migrations. I built 2 migrations and both migrated up successfully. Migrating down, the latest migration, the one that runs first, failed because of a typo in my code. I fixed the typo but the migration continued to fail after that. I discovered the reason why was that the migrating down aborted half way through changes and then when I tried to migrate down again it failed because some of the changes had already been made and so

rails database migrations using transactions

北城余情 提交于 2021-02-16 16:26:10
问题 I'm just learning Rails and have begun the section on database migrations. I built 2 migrations and both migrated up successfully. Migrating down, the latest migration, the one that runs first, failed because of a typo in my code. I fixed the typo but the migration continued to fail after that. I discovered the reason why was that the migrating down aborted half way through changes and then when I tried to migrate down again it failed because some of the changes had already been made and so

Error: Access denied for user ''@'localhost' (using password: NO)

只谈情不闲聊 提交于 2021-02-10 17:47:01
问题 I'm trying out db migrations with MySQL and Knex. When I run the command knex migrate:latest , I get ER_ACCESS_DENIED_ERROR: Access denied for user ''@'localhost' (using password: NO) I've tried adding a password on the codebase (to '123' and 'NO'), though what confuses me most is that even as I have user: "root" in my database file, the error gives an empty string as the user... I share what I imagine are the pertinent files: // mysql_db.js const knex = require('knex')({ client: 'mysql',

Flyway conditional db migration

非 Y 不嫁゛ 提交于 2021-02-10 04:15:21
问题 I'm trying to use flyway, but I have a scenario that does not know how to resolve: When I apply the STANDARD scripts, I have to run V1.0__create_table_TAB1.sql When I apply the scripts to customer1, the TAB1 table is a view, and so I have to run V1.0__create_view_TAB1_to_schema1.sql. Practically: └── sql ├── sql_common │ ├── V0.0 __.... sql │ └── V1.0__create_table_TAB1.sql ├── sql_customer1 │ └── V1.0__create_view_TAB1_to_schema1.sql └── sql_customer2 └── V1.0__create_view_TAB1_to_schema2

Flyway conditional db migration

ぃ、小莉子 提交于 2021-02-10 04:15:13
问题 I'm trying to use flyway, but I have a scenario that does not know how to resolve: When I apply the STANDARD scripts, I have to run V1.0__create_table_TAB1.sql When I apply the scripts to customer1, the TAB1 table is a view, and so I have to run V1.0__create_view_TAB1_to_schema1.sql. Practically: └── sql ├── sql_common │ ├── V0.0 __.... sql │ └── V1.0__create_table_TAB1.sql ├── sql_customer1 │ └── V1.0__create_view_TAB1_to_schema1.sql └── sql_customer2 └── V1.0__create_view_TAB1_to_schema2

Flyway conditional db migration

独自空忆成欢 提交于 2021-02-10 04:12:57
问题 I'm trying to use flyway, but I have a scenario that does not know how to resolve: When I apply the STANDARD scripts, I have to run V1.0__create_table_TAB1.sql When I apply the scripts to customer1, the TAB1 table is a view, and so I have to run V1.0__create_view_TAB1_to_schema1.sql. Practically: └── sql ├── sql_common │ ├── V0.0 __.... sql │ └── V1.0__create_table_TAB1.sql ├── sql_customer1 │ └── V1.0__create_view_TAB1_to_schema1.sql └── sql_customer2 └── V1.0__create_view_TAB1_to_schema2

How to instantiate a table object to bulk_insert rows using alembic / SQLAlchemy

五迷三道 提交于 2021-02-08 14:03:52
问题 I am trying to use bulk_insert to insert data into an existing table ( services ) in my Postgres database. How do I instantiate this table object so I can do a bulk_insert with it? I saw answers like this: Alembic bulk_insert to table with schema but I want to avoid redefining the schema again in the migration. from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql def upgrade(): """Up migration.""" services = sa.MetaData().Services() op.bulk_insert(services

Migrate postgres dump to RDS

依然范特西╮ 提交于 2021-02-07 08:09:21
问题 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

Migrate postgres dump to RDS

我的未来我决定 提交于 2021-02-07 08:08:35
问题 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