database-migration

Django CommandError: App 'polls' has migrations

橙三吉。 提交于 2019-12-09 04:24:54
问题 Trying to follow the tutorial at Django project. The problem I've come across is that when performing the command: python manage.py sql polls I'm given the error: CommandError: App 'polls' has migrations. only the sqlmigrate and sqlflush commands can be used when an app has migrations So far I can't seem to find any guide on the internet, or this website for a solution to the program. 回答1: The problem is that you are using Django 1.8 while going through 1.6 tutorial. Pay attention to the

How do I convert an Oracle database to MySQL? [closed]

断了今生、忘了曾经 提交于 2019-12-08 19:49:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . Is there a recommended tool to convert an Oracle database including (stored procedures) into MySQL? 回答1: I've asked a similar question and from the answers I got I can recommend OmegaSync, although I did not try to migrate stored procedures, but it's supported too. 回答2: Try the MySQL forums: How to migrate

How to properly unit test Realm migration

荒凉一梦 提交于 2019-12-08 04:28:07
问题 I have looked at the post here How to unit test Realm migrations and am trying to implement what they have stated which is the following: Store old .realm files and write tests for before / after migrations. I have my v0.realm file in my unit test bundle and am creating a copy of it to work with. The issue is that with my latest migration I removed a Type from my application and thus from Realm and I'd like to test that it no longer exists. When I set up my realm configuration I should be

Generate XML/ SQL output with data types of target database

不羁的心 提交于 2019-12-08 03:17:07
问题 I need to convert the structure of PostgreSQL databases to Oracle. In PostgreSQL, I have a postgres database with data. In Oracle I have a blank database in which I want to write postgres database which in PostgreSQL. In fact, I do not need the data, only the structure (relationships). For this I use Liquibase. I get the changelog from PostgreSQL with the command: liquibase \ --driver=org.postgresql.Driver \ --classpath="C:\db_drivers\postgresql-9.3-1102.jdbc3.jar" \ --changeLogFile=".

How to add computed column using migrations in code first?

旧街凉风 提交于 2019-12-08 01:40:50
问题 I have added this computed column inside my data model [DatabaseGenerated(DatabaseGeneratedOption.Computed)] public string FullName { get; private set; } After that I created it inside my database using this query ALTER TABLE [MyDataBase].[dbo].[User] ADD FullName as ([FirstName] + ' ' + [LastName]) When I run my code I get an error that my database has changed . My question How to create migration for this computed column (because it's already created using sql query) 回答1: Entity Framework

How do I rename a model with Django?

混江龙づ霸主 提交于 2019-12-08 01:04:36
问题 Let's say I have this model: class Foo(models.Model): name = models.CharField(max_length=255) I want to rename it to Bar . What steps should I take? And how do I deal with The following content types are stale prompt? 回答1: In my particular case it was like so: Rename model class name and all its references. Run ./manage.py makemigrations . Inspect your database for references from tables your apps own. Ordinary references and references via django_content_type table. Deal with them

How can I version control Stored Procedures while using flywaydb?

微笑、不失礼 提交于 2019-12-07 23:12:16
问题 I currently have a Java web app which uses a Microsoft SQL Server back end. Database migrations are currently being done manually by sqlcmd which makes use of the :r command to reference script files of our stored procedures and views. This way each stored procedure has his own file "proc_someprocedure.sql" The migration is done by an upgrade script "6.1 upgrade.sql" which refrences the proc file to drop and recreate it in it's current version. We're looking to migrate to flyway and have the

Play framework 2.4.3 evolutions not triggered

血红的双手。 提交于 2019-12-07 16:55:26
问题 I'm doing the todo tutorial of Play. When I created the evolution in conf/evolutions/default/1.sql nothing happens. I just get the Exception JdbcSQLException: Table "TASK" not found which makes sense. I applied the evolution manually to the DB with h2-browser in activator console and after that it works. But the evolutions don't show up automatically. application.conf # Database configuration # ~~~~~ # You can declare as many datasources as you want. # By convention, the default datasource is

Entity Framework 4.3.1 migrations always invokes default constructor and ignores connectionstring

不打扰是莪最后的温柔 提交于 2019-12-07 11:02:31
问题 I want to execute (code-first) migrations using a connectionString that I have constructed myself. The entry point is a static function with one parameter, the connectionString. I have a DbContext class called PocModel with both a default constructor. public PocModel() : base("PocModel") { ... And a context constructor with a string argument: public PocModel(string nameOrConnectionString): base(nameOrConnectionString) { ... My goal is to perform migrations on the database that is targeted by

How can I ignore certain schemas with alembic --autogenerate

与世无争的帅哥 提交于 2019-12-07 08:42:55
问题 I have a library that's part of a bigger project. The library uses its own schema in a (PostgreSQL) database shared with the larger project. I want to use alembic revision --autogenerate to only generate migrations for the library's schema and ignore changes to the tables in the main/default schema. Is there any option for doing this? FWIW, I've tried the include_schemas=False parameter to context.configure in env.py, but it doesn't seem to do anything. 回答1: It seems I can use include_object