database-migration

Dropping column with foreign key Laravel error: General error: 1025 Error on rename

你说的曾经没有我的故事 提交于 2019-11-27 13:23:08
问题 I've created a table using migration like this: public function up() { Schema::create('despatch_discrepancies', function($table) { $table->increments('id')->unsigned(); $table->integer('pick_id')->unsigned(); $table->foreign('pick_id')->references('id')->on('picks'); $table->integer('pick_detail_id')->unsigned(); $table->foreign('pick_detail_id')->references('id')->on('pick_details'); $table->integer('original_qty')->unsigned(); $table->integer('shipped_qty')->unsigned(); }); } public

How to use Flyway configuration to handle multiple databases

痴心易碎 提交于 2019-11-27 13:11:23
问题 we have a java application configured with maven that uses multiple databases. It is one app - many schemas. I've configured flyway, tested and it works well but my config is only for one database. Here is my pom.xml tested with one schema: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com

Heroku run rake db:migrate results in no change in the database, app restarted several times

天大地大妈咪最大 提交于 2019-11-27 13:04:38
问题 I have a problem with pushing my migrations to the production database. The issue: I've altered database schema by adding 1 column. I've migrated it to the production database: MacBook-Air-Mac:app msc$ rake db:migrate RAILS_ENV="production" [RailsAdmin] RailsAdmin initialization disabled by default. Pass SKIP_RAILS_ADMIN_INITIALIZER=false if you need it. == AddLengthColumnToBooks: migrating ========================================= -- add_column(:books, :length, :integer) -> 0.0017s ==

GenerationType.AUTO vs GenerationType.IDENTITY in hibernate

不想你离开。 提交于 2019-11-27 12:55:43
问题 Currently we are using mysql as a database and we use @Generated Value(strategy = GenerationType.IDENTITY) It's working perfectly at certain situation we need to migrate our database to Oracle at that time it's not working properly.If any one knows what's actual difference present behind this and how it's working? 回答1: How could it "work properly" (you don't define basic info like what you mean by that) with Oracle ? I don't see the relevance of AUTO to your question - that simply lets an

Database migrations for Entity Framework 4

被刻印的时光 ゝ 提交于 2019-11-27 12:28:42
问题 I've been playing with Entity Framework 4, using the model driven approach to generate the database script from my entities. This is great but I'm not sure how this works when it comes to versioning the database. I'm guessing if I wanted to use an active record type migration framework I'd have to work the other way around and generate my entities from my database? Is there any way to use the model driven approach and version the database properly? 回答1: This will be coming soon as a NuGet

Laravel : Migrations & Seeding for production data

六月ゝ 毕业季﹏ 提交于 2019-11-27 10:36:58
My application needs a pre registered data set to work. So i need to insert them in the database when i set up the application. Laravel propose two mechanisms : Database migrations : "They allow a team to modify the database schema and stay up to date on the current schema state." Database seeding : "Laravel also includes a simple way to seed your database with test data using seed classes." When I read this description, none of these solutions seems to be adapted. A similar question has been asked on stackoverflow and answered . The answer proposes to use the a database seeder to populate the

Rollback one specific migration in Laravel

ε祈祈猫儿з 提交于 2019-11-27 10:17:01
I want to rollback only : Rolled back: 2015_05_15_195423_alter_table_web_directories I run php artisan migrate:rollback , 3 of my migration are rolling back. Rolled back: 2015_05_15_195423_alter_table_web_directories Rolled back: 2015_05_13_135240_create_web_directories_table Rolled back: 2015_05_13_134411_create_contacts_table I delete both of my web_directories and my contacts table unintentionally. I never want that to happen, and if I can rollback only that specific one, this disaster will never happen. If you look in your migrations table, then you’ll see each migration has a batch number

How to change schema of all tables, views and stored procedures in MSSQL

混江龙づ霸主 提交于 2019-11-27 10:01:19
问题 Recently we were having issues on our database server and after long efforts it was decided to change the database server. So we managed to restore the database on another server, change the connection string, etc. Everything was going as planned until we tried to access the website from a web browser. We started getting errors about database objects not being found. Later we found out that it occured as a result of the modified schema name. Since there are hundreds of database objects

How do I move a redis database from one server to another?

左心房为你撑大大i 提交于 2019-11-27 08:58:28
问题 I currently have a live redis server running on a cloud instance and I want to migrate this redis server to a new cloud instance and use that instance as my new redis server. If it were MySQL, I would export the DB from the old server and import it into the new server. How should I do this with redis? P.S.: I'm not looking to set-up replication. I want to completely migrate the redis server to a new instance. 回答1: Save a snapshot of the database into a dump.rdb by either running BGSAVE or

Database migrations in a complex branching system

蹲街弑〆低调 提交于 2019-11-27 04:16:39
问题 In our current development workflow we have introduced database migrations (using Ruckusing) to keep our developers' db schema's in sync. It works great, is pretty straightforward in use but now we have switched to git as VCS we are facing the next problem in our database versioning system. When checking out a branch that has been in development for some time it might happen that the database schema has diverged alot from the schema in the branch i'm coming from. This causes database