mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-20 17:15:51 +02:00
Use natural sorting for string datatables columns when using postgres
The natural sorting solution is quite portable, so this should be possible for other database types too later
This commit is contained in:
parent
8a42dfa154
commit
9db822eabd
7 changed files with 86 additions and 11 deletions
|
@ -24,6 +24,9 @@ final class Version20240606203053 extends AbstractMultiPlatformMigration impleme
|
|||
|
||||
public function postgreSQLUp(Schema $schema): void
|
||||
{
|
||||
//Create a collation for natural sorting
|
||||
$this->addSql("CREATE COLLATION numeric (provider = icu, locale = 'en@colNumeric=yes');");
|
||||
|
||||
$this->addSql('CREATE TABLE api_tokens (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(255) NOT NULL, valid_until TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, token VARCHAR(68) NOT NULL, level SMALLINT NOT NULL, last_time_used TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, last_modified TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, datetime_added TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP NOT NULL, user_id INT DEFAULT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2CAD560E5F37A13B ON api_tokens (token)');
|
||||
$this->addSql('CREATE INDEX IDX_2CAD560EA76ED395 ON api_tokens (user_id)');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue