database-migration

How to migrate from SQLite to PostgreSQL (Rails)

女生的网名这么多〃 提交于 2019-11-29 17:09:29
问题 I'm a DB noob so please be kind with me. I'm having some issues pushing my SQLite DB to Heroku via taps gem. Talking with them, they told me one of the solutions could be converting locally my DB from SQLite to PostgreSQL. Is there an easy way to do so? Thanks More info: - DB from Rails app - I'm on Mac OS X - Just installed PostgreSQL via macports 回答1: sqlite3 development.db .dump | psql dbname username 回答2: Sequel will help you gem install sequel sequel -C sqlite://db/development.sqlite3

EF Core Add Migration Debugging

北慕城南 提交于 2019-11-29 17:06:55
问题 How can I step into OnModelCreating with a breakpoint and see if my logic is wrong or if the ModelBuilder is doing something I'm not expecting? I've seen lots of posts on how to debug the actual migration, but nothing on how to watch how the model code is being generated. I'm trying to implement some custom attributes on some of my entities, and it's being ignored; I'd like to see what my configuration is doing as it's generating the model code. 回答1: You should be able to call Debugger.Launch

Migration Access to SQL server 2012

北战南征 提交于 2019-11-29 17:00:00
For an project, I need to migrate an Access database to SQL server 2012 express, I found some ways to do this, like using Microsoft up-sizing, but this question is not very technical but just to find out alternative ways, the database in access contains confidential data, so im not allowed to see data and I want to find out is there is any procedure that can be useful for me to achieve migration with out seeing the database itself and how to verify the data is exact in both. I don't have database background so specific directions and resources is useful. I don't know how to search for specific

Ways to manage DB migrations with SQLAlchemy? [closed]

时光总嘲笑我的痴心妄想 提交于 2019-11-29 16:55:17
问题 I've looked at sqlalchemy-migrate, but it just seems like a lot of work and I haven't been able to find any useful examples. Anyone care to share how they handle this? 回答1: Check out new project Alembic: http://readthedocs.org/docs/alembic/en/latest/index.html 回答2: I don't have any personal experience with sqlalchemy-migrate , but here's a tutorial: http://caneypuggies.alwaysreformed.com/wiki/DevelopingWithMigrations If you use the scripts mentioned there, you can create migrations like this:

How to convert SQL Server database to MySQL database [closed]

天大地大妈咪最大 提交于 2019-11-29 12:02:53
I have created an website using ASP.Net, a table using SQL Server, and I have published it to a provider. What I want is to convert the MSSQL.sql file to Mysql.sql file. Is there any free software, or some code to convert it to SQL Server to MySQL ? It would be much appreciated if someone could help me. If you use phpMyAdmin to manage your MySQL (which almost all web hosts use) you can simply import the file in compatibility mode for MSSQL. To do this, go to Import -> Choose your file -> Then select "MSSQL" from SQL compatibility mode: under Format specific options. If you don't have

Programmatic data transformation in EF5 Code First migration

萝らか妹 提交于 2019-11-29 11:52:58
Is it possible to do any type of programmatic data transformation in Entity Framework 5 Code First migrations? There is an Sql () method to execute queries, but it has return type void and I don't see any way to get the results of the queries I perform. Example I have table Recipe with one-to-many relationship to Ingredient . For various reasons I want to convert this to a Ingredients JSON string property instead. The only approach I can think of is something like this: Create new column IngredientsJson For each recipe, query its ingredients, construct a JSON string programmatically and insert

Run alembic upgrade migrations in a transaction

家住魔仙堡 提交于 2019-11-29 09:57:52
Does alembic upgrade head run inside a transaction so that all database alterations succeed, or fail? If not, why was it designed this way? My understanding is alembic runs inside a transaction for databases that support it, like Postgres. If you're on a database that does not support this ( cough MySQL cough ), you can't use this functionality. Alessandro Cosentino That's something you can decide within the env.py , which is where you customize the behaviour of the migrations to suit your setup. You can see how to make sure your upgrades happen in a transaction from the template provided as

MySQL columns with DEFAULT NULL - stylistic choice, or is it?

℡╲_俬逩灬. 提交于 2019-11-29 09:09:05
In many flavors of SQL, there are three ways you can implicitly set a column to NULL on every row insertion. These are: columnname type NULL columnname type DEFAULT NULL columnname type NULL DEFAULT NULL I.e. the first one sets the NULL flag (as opposed to NOT NULL), second one leaves the NULL flag to the default value, and the third one sets the NULL flag and sets the implicit value as NULL. I've heard about how in Microsoft SQL, the second variation is not exactly the same since you can also customize the default value of the NULL flag for tables or schemas. But for MySQL, I don't believe

EF Migrations for Database-first approach?

♀尐吖头ヾ 提交于 2019-11-29 05:24:27
We're using Database first approach with EntityFramework. We've several customers, and when we deploy new product version, we're now applying DB schema changes "manually" with tools like SQL Compare . Is there a way how EF Migrations could help to apply changes to customers DB automatically? Paul As far as I know, EF Migrations is a product targeted at CodeFirst and doesn't support Database First operations. CodeFirst assumes that you will never make any changes manually to the database. All the changes to the database will go through the code first migrations. I think there is! You need to

Django renaming App and migrations

夙愿已清 提交于 2019-11-29 05:20:20
I have django app named "app1" with models and migrations files. I renamed this app to "app2" and I fixed all imports, urls ... But I have a problem with migrations files and data in tables. How can I write migrations with the correct way to ensure: - New installation => create the new tables - Update old versions => create new tables, move data, remove old tables PS: there is several tables with many FK. Here is my progress, I am not sure if I am on the good way: - all old migrations removed - makemigrations to generate new migrations files After this 2 steps I can install my application, but