When I do a schema compare on an Azure database, the schema compare tool says "Comparison Complete. Differences Detected" at the bottom, but the center screen remains empty except for the message:
You can compare a source schema with a target schema to determine differences between them. You can then update the target schema to match the source schema for database objects you select. Depending on the target schema type you can either update the target directly or generate an update script. To compare two schemas first select a source schema and target schema, then select Compare.
I have tried reentering all of my credentials and re-cloning my repo.
I have also tried doing a schema compare with the same project against a different Azure database and the results DO show up.
My co-workers are able to schema compare with the exact same project and remote database just fine, changes are shown.
You need to look at Error List tab to identify the actual error.
Mostly it could be due to Timeout that has happened before the changes are loaded, and it is a transient issue.
You could increase the timeout of the connection when you choose the source or destination connection -> Advanced -> Connect Timeout
Export both Data Bases to .dacpac. And select the option Data-tier Application File.
Related
Some time ago two new types were created without deployment tables and their items were stored in ComposedType's table. After a while, this problem was noticed and deployment tables were added to *-items.xml but these two tables aren't created during update. How can I handle this problem? Unfortunately, I can't use init on our environments.
You need to define two new itemtypes with the desired deployment table in the items.xml and perform system update. Then, you need to import the data from the two old itemtypes to the new itemtypes. Finally, you need to delete the old columns using SQL command and clear the orphaned types from hAC.
I started working with mongodb yesterday and can't seem to generate a database on the console. Every time I do the
use exampledb
switched to db exampledb
but for some reason I still generate only my locals..?
show dbs
local 0.078GB
I created a folder called /data/db in my root directory (following the tutorial) so I'm not sure what I am missing... help appreciated!
You are not missing anything. exampledb will be shown (using show dbs) only when you insert atleast one document in it. You can add collections manually if you want using db.createCollection().
Your database need to have atleast one document inside. First we need to add atleast one document into the selected database.
Example:
db.mycollection.insert({"name":"Max"})
where db is the general term not the name of the database and mycollection is the name of your collection, inside the insert give as key value pairs)
After that you can see your database.
Insert one Document and the "show dbs" command will display your database
With Entity Framework it is possible to enable migrations and create migration steps. But is there an intermediate way where it is possible to change the models, and take care of database schema changes yourself? I don't want to drop the database, because there are future production schenario's.
Now - without enable migrations - I use a code first, and when I create another property in a DbSet - lets assume for example in table 'ExistingTable' int NewField {get; set;}
And when in SQL I update my schema with
Alter table ExistingTable add column NewField int not null
the database knows existence of the new field, the Entity Framework / C# knows the property, but when running, there is some hidden check that still want's to drop my database because of the model change.
Question: can I overwrite a certain setting, in such a way that intial 'Code First' can be transformed to database first?
Removing the __MigrationHistory table from the database (Azure) did work fine for me. I made my (simple) database changes myself and published the code. It all runs fine. There is an alternative see EF Code First Migrations Deployment to an Azure Cloud Service. For a simple one-way patch (and no change history needed) removing the __MigrationHistory works fine.
TLDR; How do you add a full text index using Entity framework 5 coded migrations
I'm having issues adding a full text index to a database using Entity framework migrations. It needs to be there from the start so I'm attempting modifying the InitialCreate migration that was automatically generated to add it.
As there isn't a way to do it via the DbMigrations API I've resorted to running inline sql at the end of the 'Up' code.
Sql("create fulltext catalog AppNameCatalog;");
Sql("create fulltext index on Document (Data type column Extension) key index [PK_dbo.Document] on AppNameCatalog;");
When this runs everything gets created fine until it reaches this sql, then it throws the the sql error 'CREATE FULLTEXT CATALOG statement cannot be used inside a user transaction.'. Which is expected and working as designed.
Thankfully Sql() has an overload that allows you to run the sql outside the migration transaction. Awesome! I thought.
Sql("create fulltext catalog AppNameCatalog;", true);
Sql("create fulltext index on Document (Data type column Extension) key index [PK_dbo.Document] on AppNameCatalog;", true);
But low and behold modifying the code to do this (see above) results in a new timeout error 'Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.'
I've tried spitting out the sql and running it manually and it works fine. I've also diff'd the generated sql with and without running it outside a transaction and they are identical so it must be something in the way sql is executed.
Thanks in advance for any help!
I had a similar problem. My InitialCreate migration was creating a table and then attempting to add a full text index to that table, using the overloaded Sql() to indicate that it needs to execute outside the transaction. I was also getting a timeout error and I suspect it's due to a thread deadlock.
I could get it to work in some scenarios by using Sql() calls instead of CreateTable() and by merging the CREATE FULL TEXT CATALOG and CREATE FULL TEXT INDEX statements into a single Sql() call. However, this wasn't very reliable. Sometimes it would work and sometimes it would fail with the same timeout error.
The only reliable solution I found was to move the creation of the catalog and full text index into a separate migration.
When I try to run a report in COGNOS Report Studio, I get error : ORA-00918: column ambiguously defined
Now there is no way to get the runtime sql and test it out against the oracle db. So I am left groping around.
My question is...when we develop the model in framework manager, we do not write our own sql. Just specify the tables and columns and joins. So the error should never come because this error come when you forget to prefix a column name with the table alias.
I agree it is odd. Start removing data items from the query until it works. Try to narrow it down to a specific data item within a table. See what SQL is generated without the offending field, that should give you a hint as to what is going on.