database-migration

Rollback one specific migration in Laravel

蹲街弑〆低调 提交于 2019-11-27 04:02:38
问题 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

Problems setting a custom primary key in a Rails 4 migration

独自空忆成欢 提交于 2019-11-27 03:34:44
问题 I use postgresql 9.3, Ruby 2.0, Rails 4.0.0. After reading numerous questions on SO regarding setting the Primary key on a table, I generated and added the following migration: class CreateShareholders < ActiveRecord::Migration def change create_table :shareholders, { id: false, primary_key: :uid } do |t| t.integer :uid, limit: 8 t.string :name t.integer :shares t.timestamps end end end I also added self.primary_key = "uid" to my model. The migration runs successfully, but when I connect to

Entity Framework 4.3 - TPH mapping and migration error

好久不见. 提交于 2019-11-27 02:48:50
问题 I'm using Entity Framework 4.3 with code first and manual migrations. I'm trying to map a TPH (table-per-hierarchy) setup which uses two custom discriminator fields. One for the discriminator itself and the other for soft deletes (much like the "where" option in NH class mappings). The exact same setup works just fine in another project which runs on EF 4.2. I get the error when trying to add a migration using the "add-migration" command in the NuGet console. I have tried all combinations of

Use one Laravel migrations table per database

家住魔仙堡 提交于 2019-11-27 00:52:18
I work in a project that uses multiple databases. It seems like Laravel only uses the migrations-table in the database that is set as default. I would like one migrations table per database that logs the migrations that have been done to that specific database. Is this possible? I have defined the databases in the config like this: 'connections' => [ 'db1' => array( 'driver' => 'mysql', 'host' => 'db1.host', 'database' => 'db1', 'username' => 'username', 'password' => 'password', ), 'db2' => [ 'driver' => 'mysql', 'host' => 'db2.host', 'database' => 'db2', 'username' => 'username', 'password'

Sequelize.js: how to use migrations and sync

喜欢而已 提交于 2019-11-26 23:46:26
问题 I'm close to having my project ready to launch. I have big plans for after launch and the database structure is going to change -- new columns in existing tables as well as new tables, and new associations to existing and new models. I haven't touched migrations in Sequelize yet, since I've only had testing data which I don't mind wiping out every time the database changes. To that end, at present I'm running sync force: true when my app starts up, if I have changed the model definitions.

Merge identical databases into one

假装没事ソ 提交于 2019-11-26 23:40:43
问题 We have 15 databases of 75 tables with an avarage of a million rows. all with the same schema but different data. We have now been given the requirements by the client to bring all 15 into one database. Each set of data filtered by the user’s login. The changes to the application have been completed to do the filtering. We are now left with the task of merging all databases into one. The issue is conflicting PK and FK as the PK’s and the FK’s are of type int so we will have 15 PK ids of 1.

How do I copy SQL Azure database to my local development server?

為{幸葍}努か 提交于 2019-11-26 23:21:41
Does anyone know how I can copy a SQL Azure database to my development machine? I'd like to stop paying to have a development database in the cloud, but it's the best way to get production data. I copy my production database to a new development database but I'd like to have that same database local. Any suggestions? seva titov There are multiple ways to do this: Using SSIS (SQL Server Integration Services) . It only imports data in your table. Column properties, constraints, keys, indices, stored procedures, triggers, security settings, users, logons, etc. are not transferred. However it is

No connection string named 'MyApplicationEntities' could be found in the application config file

和自甴很熟 提交于 2019-11-26 19:56:12
问题 I just install EF 4.3 and trying to upgrade my project with migration. however I am getting issues with trying to execute add-migration initial to my project via Package Manager console. It is throwing any exception now No connection string named 'MyApplicationEntities' could be found in the application config file. Now my config has it all <connectionStrings> <add name="MyApplicationEntities" connectionString="metadata=res://*/DataModel.csdl|res://*/DataModel.ssdl|res://*/DataModel.msl

Access denied for user 'homestead'@'localhost' (using password: YES)

自古美人都是妖i 提交于 2019-11-26 19:23:13
I'm on a Mac OS Yosemite using Laravel 5.0. While in my local environment, I run php artisan migrate I keep getting : Access denied for user 'homestead'@'localhost' (using password: YES) Configuration Here is my .env APP_ENV=local APP_DEBUG=true APP_KEY=***** DB_HOST=localhost DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret app\config\database.php 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'database' => env('DB_DATABASE', 'homestead'), 'username' => env('DB_USERNAME', 'homestead'), 'password' => env('DB_PASSWORD', 'secret'), 'unix_socket' => '/tmp

EF Migrations: Rollback last applied migration?

大兔子大兔子 提交于 2019-11-26 18:42:15
问题 This looks like a really common task, but I can't find an easy way to do it. I want to undo the last applied migration. I would have expected a simple command, like PM> Update-Database -TargetMigration:"-1" Instead, all I can come up with is: PM> Get-Migrations Retrieving migrations that have been applied to the target database. 201208012131302_Add-SystemCategory 201207311827468_CategoryIdIsLong 201207232247409_AutomaticMigration 201207211340509_AutomaticMigration 201207200025294