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.

SQL Server connector only allows globally unique index names

See original GitHub issue

After running introspect, prisma is throwing this error because of the index names. This might cause issues to keep evolving the model moving forward because the migrations would go crazy with the indexes 😬

image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, May 7, 2021

And it should be fixed 😄

1reaction
janpiocommented, May 6, 2021

Right, the error message complains about “globally unique”. That does not seem to be true for SQL Server, while it is probably true for some other database.

Code for this: https://github.com/prisma/prisma-engines/blob/789a706435edd011021ae544bad8e2bf582efd9f/libs/datamodel/core/src/transform/ast_to_dml/validate.rs#L216-L252 So supports_multiple_indexes_with_same_name() is wrong for the SQLServer connector probably.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sql server - name of index need to be unique in database?
Is the name of the index. Index names must be unique within a table or view but do not have to be unique...
Read more >
Create Unique Indexes - SQL Server - Microsoft Learn
This topic describes how to create a unique index on a table in SQL Server by using SQL Server Management Studio or Transact-SQL....
Read more >
Microsoft SQL Server - Prisma
Microsoft SQL Server only allows one NULL value in a column that has a UNIQUE constraint. For example: A table of users has...
Read more >
Creating Tables - SQL Server to Aurora MySQL Migration ...
When creating a new table using SELECT INTO , the only attributes created for the new table are column names, column order, and...
Read more >
SQL error messages and exceptions - Oracle Help Center
08001, A connection could not be established because the server name ... caused a duplicate key value in a unique or primary key...
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