question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SQLite Migrations: Preserve column max length

See original GitHub issue

Currently, SQLite has a very trivial type mapping so string properties are always mapped to TEXT columns. We could preserve the HasMaxLength() metadata in the database schema if we wanted. The column would map to something like TEXT(30). SQLite effectively ignores any length/precision/scale values, but we could still honor their semantics during reverse engineer.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rojicommented, Mar 17, 2021

@AdamJachocki many users are successfully using migrations on Sqlite - you’re going to have to open a new issue and share your model and migration.

0reactions
AdamJachockicommented, Mar 17, 2021

I have a model. Next, I create a migration using dotnet ef migrations add. Next I use Migrate() method on db context. That’s all.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Max length not applied in migration
I am using efcore.sqlserver 1.0.1 with preview2 tools - I have a string property which in sql server is created as an nvchar(max)...
Read more >
Implementation Limits For SQLite
The maximum number of bytes in the text of an SQL statement is limited to SQLITE_MAX_SQL_LENGTH which defaults to 1,000,000,000. If an SQL...
Read more >
Comparing VARCHAR(max) vs VARCHAR(n) data types in ...
This article gives an overview of varchar(max) data type and its comparison with the varchar(n) data type.
Read more >
why are large sqlite transactions slow?
A column has a max BLOB size of 2Mib ( 1024 * 1024 * 2 bytes). Could someone explain to me what exactly...
Read more >
Appendix: SQLite
The maximum size of a text or BLOB value is limited by a compile-time directive. The default limit is exactly one billion bytes,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found