-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhelpful error messages (first migration) #136
Comments
As usual, thanks for the detailed bug report, and sorry for the delay addressing this. After #152, this is what will happen to error messages: (1) First migration empty
(2) First migration only connection stringExactly the same as (1). (3) First migration with connection string and SELECTOnly the beginning of the error changes:
(4) First migration only no transactionSame as (1) and (2). (5) First migration with no transaction and connection stringSame as (1), (2) and (4). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As detailed in my Codd Experiment blog entry, I experimented with first migrations in an attempt to find one that gets Codd to initialize the database (create the
codd_schema.sql_migrations
table) without creating the database itself. In doing so, I ran into a number of error messages that could probably be improved. These are recreated in the following log.(0) Setup
Run a test database:
Create a test project:
Configure settings in
config/codd-dev.sh
:Load settings in the current shell:
(1) First migration empty
Create an empty migration:
Attempting to add an empty migration results in an
SqlError
because thecodd_schema.sql_migrations
table does not yet exist.It would probably be better to check if the table is in the database before attempting to use it. It would then be possible to provide a better error message.
(2) First migration only connection string
Create a first migration that only has a custom connection string:
Attempting to add this migration results in a connection string error, even though the connection string is valid.
The code has a check that the custom connection string is different from the default connection string, but we get the same error when the connection strings differ.
(3) First migration with connection string and SELECT
Copy the previous migration and add a
SELECT
statement:Attempting to add this migration results in the same
SqlError
! It is notable that adding a statement changes the error message. If Codd requires that every migration have at least one statement, perhaps it should provide an error message to inform users of this when a migration has no statements.(4) First migration only no transaction
Create a first migration that only configures
no-txn
:Attempting to add this migration results in a puzzling error message.
(5) First migration with no transaction and connection string
Create a migration that specifies no transaction and a custom connection string:
Attempting to add this migration results in the connection string error.
The text was updated successfully, but these errors were encountered: