-
Notifications
You must be signed in to change notification settings - Fork 235
Scaffold-DbContext error 42703 (EF Core 2.0) : column "start_value" does not exist #246
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
Comments
Have same issue when migrating from PostgreSQL to MySQL via MySQL Workbench. Get error: File "/usr/lib/mysql-workbench/modules/db_generic_re_grt.py", line 76, in execute_query return cls.get_connection(connection_object).cursor().execute(query, *args, **kwargs) pyodbc.ProgrammingError: ('42703', '[42703] ERROR: column "start_value" does not exist;\nError while executing the query (1) (SQLExecDirectW)') How to fix this?? |
I have the exact same issue as OP. Any hints? |
Unfortunately I haven't been able to solve this (luckily it's for a feature I can put off implementing for a couple more weeks, figured I would wait for a response from @roji ) |
@abramlage can you confirm that your PostgreSQL version is older than 9.1? This error is probably a result of trying to scaffold sequences and trying to find out what the starting value is. Here are the PostgreSQL docs for the relevant table, the If you're on PostgreSQL 9.0, it's strongly recommended you upgrade - the oldest version that's still officially supported by PostgreSQL themselves is 9.3. Having said that, it should be relatively easy to fix this in the Npgsql scaffolding code. |
As a sidenote, note that you can always write the database model yourself - strictly speaking scaffolding issues shouldn't block you. Another option to work around this is to dump your database schema, load it to another database and drop the sequences. You'll get all the tables and columns scaffolded, and can use this as a starting point. |
It is much older than 9.1, unfortunately I have no control over this database and it is not actively maintained. If there is nothing new and fancy that is needed, I can just grab the previous scaffolded version from my old project. |
OK, in that case I'll close this issue. If anyone in there future has a burning need to scaffold a pre-9.1 PostgreSQL please post back here and I'll see about reopening. |
We're writing a new version of our application in asp.net core, that requires us to connect to an existing PostgreSQL database (we have no control over this database and it has not changed in years). We connected to this in the previous .Net version of this project with no trouble (scaffolding with the "CopyMe.PostgreSQL.tt" file). However, when trying to use the Scaffold-DbContext command I am unable to do so because of the above error. I can't tell what table it is failing to scaffold, but there are two tables that do have a "start_date" column.
*Edited to add, this is for version 2.0
The text was updated successfully, but these errors were encountered: