Comments (6)
SQLite does not directly support schemas. You have to attach a database to the connection. This is definitely working correctly. What steps did you do to debug this?
If a schema-name is specified, it must be either "main", "temp", or the name of an attached database. In this case the new table is created in the named database. If the "TEMP" or "TEMPORARY" keyword occurs between the "CREATE" and "TABLE" then the new table is created in the temp database. It is an error to specify both a schema-name and the TEMP or TEMPORARY keyword, unless the schema-name is "temp". If no schema name is specified and the TEMP keyword is not present then the table is created in the main database.
from fluentmigrator.
Thanks for the response and documentation. You're right that the schema-name ("public") is not "main", "temp", or the name of the database. Any idea why this works in v3.3.2? If this was a breaking change, is there any FluentMigrator documentation that explains an upgrade path -- which maybe is follow the SQLite documentation for schema-name?
Here is how the service collection is being setup.
new ServiceCollection()
.AddFluentMigratorCore()
.ConfigureRunner(rb => rb.AddSQLite().WithGlobalConnectionString("Data Source=test;Mode=Memory;Cache=Shared").ScanIn(assemblies).For.Migrations())
.BuildServiceProvider();
from fluentmigrator.
I don't know. We don't have regression tests for incorrect usage "working". What did you do to debug this so far?
My guess is the underlying library is doing magic for you.
from fluentmigrator.
I haven't debugged past updating to the latest versions of Microsoft.EntityFrameworkCore.Sqlite and FluentMigrator. Using v5.2.0 of FluentMigrator for SQLite does not work with the latest stable version (v8.0.3) of Microsoft.EntityFrameworkCore.Sqlite. Using v3.3.2 of FluentMigrator does work with the latest stable version of Microsoft.EntityFrameworkCore.Sqlite. So it seemed to me that it was a change in FluentMigrator, not the underlying library.
Based on the SQLite documentation you referenced, it sounds like there was probably a breaking change (intentional or not) to the SQLite runner to not support an incompatible SQLite schema-name -- that's fine. I was just trying to understand what the upgrade path from a FluentMigrator perspective was. Sounds like the answer is to use a valid SQLite schema-name.
from fluentmigrator.
I had a reply written but it got lost somehow.
Put simply, in 3.3, Sqlite Generator ignored the schema. In 5.0, it assumes you have attached a second database corresponding to the schema argument in the migration.
To revert to 3.3 behavior, remove the InSchema and With Schema from your code. If you deploy to multiple DB providers, use IfDatabase to handle SQLite and (processorId ) => processorId! = ProcessorId.SQLite
If you query your sqlite_schema table after running the migration against 3.3, the issue will be clear.
from fluentmigrator.
That makes sense. Thanks for the explanation and help.
from fluentmigrator.
Related Issues (20)
- Update dependabot.yaml to support grouped updates HOT 5
- Tests failing on M1 Mac due to newline character comparison
- Remove obsolete property GenericGenerator.compatabilityMode HOT 1
- Still no migrations found using the fm tool. HOT 1
- How to determine the current runner default schema from within a migration? HOT 11
- GitHub AzureDevOps Pipeline Branch Filters no longer triggering CI builds
- Remove Obsolete ApplicationContext
- How to get rid of "Description:" in every column description? HOT 2
- Can no longer create foreign key on SQLite with FluentMigrator.Runner 5.2.0
- Unhandled exception. System.TypeLoadException: Could not load type 'FluentMigrator.Runner.Constraints.MigrationConstraintAttribute'
- Creating a MySql 8 Table with CurrentUTCDateTime Causes MySQL Syntax Error HOT 4
- AsBoolean() creates INTEGER column instead of Boolean/BIT on SQLite HOT 14
- Creating PrimaryKeys constraint get different constraint names HOT 3
- Request to add a fluent entity existence check to entity creation and deletion statements HOT 1
- The test method "CanCreateIndexWithVacuumCleanupIndexScaleFactor" fails in the master branch
- We need MongoDB support for at least a minimal subset of migration operations
- SqlServer Runner - "StackOverflowException Operation Caused a stack overflow" HOT 1
- Is it possible to create an automatic table with fluentmigrator? HOT 2
- More options when creating tables needed HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluentmigrator.