Skip to content

Commit

Permalink
Add a specific introspection test for CRDB 23.1
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelff committed Nov 22, 2023
1 parent dfee234 commit 59c797b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
-- tags=cockroachdb
-- exclude=CockroachDB231

CREATE TABLE "User" (
id INT4 GENERATED BY DEFAULT AS IDENTITY,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
-- tags=CockroachDB231

CREATE TABLE "User" (
id INT4 GENERATED BY DEFAULT AS IDENTITY,
CONSTRAINT "User_pkey" PRIMARY KEY (id)
);

CREATE TABLE "Post" (
id INT4 GENERATED BY DEFAULT AS IDENTITY,
user_id INT4 REFERENCES "User"(id),
CONSTRAINT "Post_pkey" PRIMARY KEY (id)
);

ALTER TABLE "Post"
ADD CONSTRAINT "second_fk"
FOREIGN KEY (user_id)
REFERENCES "User"(id);


/*
generator js {
provider = "prisma-client-js"
}
datasource db {
provider = "cockroachdb"
url = env("DATABASE_URL")
}
model Post {
id Int @id @default(sequence(maxValue: 2147483647))
user_id Int?
User User? @relation(fields: [user_id], references: [id], onDelete: NoAction, onUpdate: NoAction)
}
model User {
id Int @id @default(sequence(maxValue: 2147483647))
Post Post[]
}
*/

0 comments on commit 59c797b

Please sign in to comment.