Skip to content

Make the "Version" column case insensitive#466

Merged
loic-sharma merged 2 commits intomasterfrom
db-version-case-insensitive
Feb 9, 2020
Merged

Make the "Version" column case insensitive#466
loic-sharma merged 2 commits intomasterfrom
db-version-case-insensitive

Conversation

@loic-sharma
Copy link
Owner

@loic-sharma loic-sharma commented Feb 8, 2020

Background

BaGet is case sensitive on versions, which prevents unlisting/deleting a package that has uppercased letters in its version string (see #458). This only affects the SQLite and PostgreSQL drivers.

SQLite

⚠SQLite does not support altering columns (see this). Customers will need to recreate their database and then reupload all their packages to get this fix:

  1. Delete the SQLite database: rm baget.db
  2. Run BaGet to recreate the database
  3. Reupload all the packages:
    1. Navigate to your storage folder: cd packages
    2. Push all packages: dotnet nuget push .\**\*.nupkg --source http://localhost:5000/v3/index.json

Implementation

Test plan
  • PostgreSQL
    • Test on a fresh database
    • Test on an existing database after migrating
  • SQLite
    • Test on a fresh database
    • Test migration no-ops on an existing database
    • Add instructions on how to rebuild SQLite database

@loic-sharma loic-sharma changed the title Add SQLite and PostgreSQL migrations Make the "Version" column case insensitive Feb 8, 2020

<ItemGroup>
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.0" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.1.2" />
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package upgrade is necessary as npgsql's identity migration is broken on v3.1.0. This was fixed in 3.1.1.1.

@loic-sharma loic-sharma merged commit e2c1d18 into master Feb 9, 2020
@loic-sharma loic-sharma deleted the db-version-case-insensitive branch February 9, 2020 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant