database-migration

Django: loaddata in migrations errors

亡梦爱人 提交于 2019-12-22 05:16:44
问题 Something really annoying is happening to me since using Django migrations (not south) and using loaddata for fixtures inside of them. Here is a simple way to reproduce my problem: create a new model Testmodel with 1 field field1 (CharField or whatever) create an associated migration (let's say 0001 ) with makemigrations run the migration and add some data in the new table dump the data in a fixture testmodel.json create a migration with call_command('loaddata', 'testmodel.json') : migration

SQL Server 2014 backup to 2012

佐手、 提交于 2019-12-22 03:51:56
问题 Are there any tools to convert SQL Server 2014 database to 2012? I tried Generate Script but the generated script with data is too large and SQL Server Management Studio did not execute it, I need to have both schema and data. 回答1: To my knowledge, there are basically three two options for migrating a database to a lower version of SQL Server, without using 3rd party tools: Generate Scripts (not really suitable for large amounts of data) Custom Scripting and BCP or Import/Export Wizard SQL

Laravel 4 Migration error - creates two auto_increment primary keys fields

霸气de小男生 提交于 2019-12-22 03:40:58
问题 I made a migration with this setup: $table->increments('id'); $table->integer('user_id', 10)->unsigned(); // this is meant to be used as a foreign key After doing php artisan migrate it returns an error: [Exception] SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key (SQL: create table `transactions` (`id` int unsigned not null auto_increment primary key, `user_id` int unsigned not null auto

Django NodeNotFoundError during migration

坚强是说给别人听的谎言 提交于 2019-12-22 02:03:13
问题 The error I get when I try to runserver for my django app is as follows: django.db.migrations.graph.NodeNotFoundError: Migration tasks.0001_initial dependencies reference nonexistent parent node (u'auth', u'0007_alter_validators_add_error_messages') This happened after I followed this heroku tutorial: https://devcenter.heroku.com/articles/getting-started-with-django I modified the settings file to include: import dj_database_url SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

Django NodeNotFoundError during migration

五迷三道 提交于 2019-12-22 02:02:14
问题 The error I get when I try to runserver for my django app is as follows: django.db.migrations.graph.NodeNotFoundError: Migration tasks.0001_initial dependencies reference nonexistent parent node (u'auth', u'0007_alter_validators_add_error_messages') This happened after I followed this heroku tutorial: https://devcenter.heroku.com/articles/getting-started-with-django I modified the settings file to include: import dj_database_url SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

Database Migration with Liquibase using different DBMS

限于喜欢 提交于 2019-12-21 19:38:13
问题 Our customer is using Oracle and we want to use MySQL for development. Therefore our MySQL Scheme has to be in sync with Oracle. I tried to use Liquibase, but I get problems at the time of applying a changeset because of the db specific sql and different column types like NUMBER <-> BIGINT or VARCHAR <-> VARCHAR2 Am I using these tools wrong? How to solve this type of problem? 回答1: Liquibase will attempt to convert standard types like "varchar", "int", "boolean", "datetime" to the correct

Is it considered safe to manually edit schema.rb in rails

吃可爱长大的小学妹 提交于 2019-12-21 12:43:30
问题 I came across a problem where I was working on two branches on a rails project and each project has a migration to add a column. At the time, rake db:migrate:reset cause a problem and I solely relied on my schema.rb to correctly represent the state of my database. At one point, I came across a problem where a column added by branch A got into the schema of branch B. Since migrate:reset was not an option, I resorted to manually editing the schema file to. I committed this change that basically

Django 1.7 Migrations hanging

风格不统一 提交于 2019-12-21 11:48:06
问题 I have a django migration I am trying to apply. It gets made fine (it's small, it's only adding a CharField to two different Models. However when I run the actual migrate it hangs (no failure, no success, just sits). Through googling I've found that other open connections can mess with it so I restarted the DB. However this DB is connect to continuously running jobs and new queries do sneak in right away. However they are small, and last time I tried restarting I THINK I was able to execute

Adding fields to an already existing database for Django (version < 1.7)

倖福魔咒の 提交于 2019-12-21 08:00:22
问题 I'm using Django ( < v1.7), with SQLite3 as the database engine. I am trying to add a new field to an already existing model's class. This class already has data associated to it. manage.py syncdb is not adding the new fields to the db. Is there was a way to: Add the new Field to the already existing class, and make sure a db entry is allocated to it? Populate this new field with an empty string for all the already existing db entries? 回答1: Install south in your django and you can easily

Parse migration to heroku/aws regarding the image

久未见 提交于 2019-12-21 05:47:30
问题 I have successfully migrated my parse db to aws but the urls of image files still like http://files.parsetfss.com/77447afb-f681-4b55-afad-6bceeb2e155a/tfss-79297c86-bd48-4d7f-87ab-c43e02d1a8f3-photo.png it means files are still on parse s3 cloud or something their own storage so what will happen to those files after parse shutdown. what is the way to migrate the images to new database/storage on my own AWS. I am worried because I have apprx 14.5 k images on parse. Please provide you valuable