flyway schema history table name - flyway

We've been using flyway for schema migrations, versions 4.x/5.x - the table is named schema_version. Now we are looking to move to latest version, 7.x. I've seen some information that states the new table name has changed to flyway_schema_history, but then I just saw this where the table name looks to be named flyway_history_schema (https://flywaydb.org/documentation/concepts/migrations#schema-history-table).
Can anyone who uses flyway confirm the schema history table name?
Thanks,
Scott

The default name for the table is indeed flyway_schema_history
The part of the documentation you linked to is referring to the situation when Flyway is not allowed to create new schemas by its configuration, and you need to manually create a schema for that table to live in. "flyway_history_schema" is a suggested name for the schema, not the table.

Related

ScyllaDB - DynamoDB Migration

Agenda- Migrate DynamoDB tables to ScyllaDB (Schema as well as data)
Does the Scylla-Migrator - https://github.com/scylladb/scylla-migrator can migrate the table schema as well, or I have to create the exact schema in my ScyllaDB and then it can just migrate the data?
you need to create the keyspace and table in remote cluster,
migrator can map old table to new table layout if needed.
The reason why we don't migrate schema automagically is that most of times you want to have it different (e.g. different compactions strategy, or new columns)
and then having this as manual step makes sure you can review your schema before using it.
That said I think it makes sense to ask for a special flag that will just migrate old schema for you to new cluster - https://github.com/scylladb/scylla-migrator/issues - can you file it there?

Referenced table is not in dictionary

When I scaffold my database get the following error:
Referenced table `contentcategory` is not in dictionary.
Referenced table `contentcategory` is not in dictionary.
Referenced table `contenttype` is not in dictionary.
Referenced table `content` is not in dictionary.
I Use Mysql and Pomelo.EntityFrameworkCore.MySql
This is very likely to be a casing issue, where MySQL assumes the table name to be contentcategory for the reference, while it is actually something like ContentCategory.
We have a pull request for this open since April, that looks abandoned by the original contributor.
I will fix the PR and merge it, so that the workaround for this issue will be part of our nightly builds as of tomorrow.
The linked PR also contains the information of how this issue can arise:
Okay, that is in line with what I experienced as well. So manually (either by writing the name in the GUI or by using an ALTER TABLE statement directly) adding a reference with different casing (on a server with case insensitive file name handling) or disabling SQL Identifiers are Case Sensitive [in MySQL Workbench] can lead to this result.
Technically, this is a MySQL or Workbench bug, but we will implement a workaround for it anyway.

Update-database with code first and foreign key that's required not working

When using code first i have this scenario:
I have an existing database where tables are created with Code first.
Know suddenly there needs to be a change in the program and there is a new table that is related to the Primary table (with existing data in it).
Example there is a table "Package" and a the new table is "PackageState"
Steps
Create new domain Packagestate with some properties.
Add property packagestate (FK) in Package domain.(P) Note that the packagestate is required.
In the seeding class i add some data for the packagestate
From this point i have a problem, because the value is required, and the seeding method is only executed after update.
How do you solve this with code first?
Because it's possible that there is a new migration file as well.
I need some feedback on this thanks in advance!
You must make your foreign key nullable and update your database
after that you can run your seed.
and after all you should change your foreign key to not null.

Entity framework error "Invaid column name" while update record after renaming table

I am using asp.net 4.5 with EF to add/update/delete record.
I renamed a database table StatusMaster to Status.
To reflect this change in entity, I have used "update model from database" in which I have deleted the table first.
Then I have deleted the table from the diagram using "Delete Model".
Then I added table to the edmx file using "Update Model from Database".
I also have update related code in application.
Now Add() method is working well but while update method it gives me error "Invalid column name 'Id'". This column was the primary key before I update but I have also renamed it to "StatusId" but I don't think it should affect it because I already have deleted and added the table using "Update model from database".
Please help me.
All the more reason I prefer code first. More work to set up but easier to make changes down the line. Ill suggest you do the following.
Delete the entire EDMX
Delete Connection Details from config section in Web.config
Re-Create EDMX
I discovered that is faster that trying to debug ur relationship in the EDMX diagram

EF Code First, no edmmetadata table

I am reading through the book EF Code First by Julie Lerman. In the book, a database is created which contains tables generated from the domain model, as well a table named edmmetadatatable. Apparently, this table is needed for checking if there are any changes made to the other tables.
But, I don't have it. And I don't know how to get it.
One thing I did differently from the book was that I added my own connection string since code first defaults for SQLEXPRESS and I don't have SQLEXPRESS.
The book is covering Entity Framework 4.2 which uses the EdmMetadata table. When migrations were introduced in EF 4.3, a __MigrationHistory table was introduced instead.
See here for more information.

Resources