how to add a new table using EFCodeFirst to the existing database aspnetdb.mdf? - asp.net

I have not found information how to do the following:
how to add a new table using EFCodeFirst to the existing database aspnetdb.mdf?

Seems EFCodeFirst CTP5 is only able to create databases from scratch, and not generate tables in existing ones. :/

Related

flyway schema history table name

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.

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?

Knowing web sql database is already created or not

Is there any way to know wheather new database is created or connected to existing one, when calling window.openDatabase() ? I think i have to create tables only when newly created.
Don't worry about the openDatabase() command. Instead modify your SQL so it only creates the tables if they don't exist like so:
CREATE TABLE IF NOT EXISTS DEMO (id unique, data)

Can you write to an Entity Framework database using plain SQL

Can someone help me answer these questions on EntityFramework?
Does it do anything special to the database? (like extra tables)
Can I add data directly with SQL without breaking EF?
Can I add tables and fields without breaking EF?
Yes you can access database with plain SQL when using EF.
No. EF just uses database. There is one exception in code first approach where EF can create one additional table for its own purpose called EdmMetadata.
Yes you can add data directly with SQL. If both your entity model and database are defined correctly it will not break EF.
Yes you can add new tables directly but EF will not know about them. You should not change existing tables because it can break EF.
You can do it with:
var context = new YourObjectContext();
var s = context.ExecuteStoreCommand("some query");
if your query create a table, this only create a table on db and not effected on EF

How do I drop a column from a sqlite database table?

I want to remove a column from a table.
How can I do this?
As per the documentation, this is not possible without creating a new table. The method involves creating a new table (either temporary or the new table, depending on the complexity of changes), copying the data you need into it, deleting the old table, and remaking the table (if necessary).
You need simply to copy data you need to another table. Check out an example here:
robbiebow

Resources