mirror of
https://github.com/launchbadge/sqlx
synced 2024-11-10 06:24:16 +00:00
test(postgres): make test_enum_type more resilient
This commit is contained in:
parent
d360f682f8
commit
52408f3cbf
1 changed files with 5 additions and 8 deletions
|
@ -78,20 +78,17 @@ async fn test_enum_type() -> anyhow::Result<()> {
|
|||
|
||||
conn.execute(
|
||||
r#"
|
||||
DO $$ BEGIN
|
||||
|
||||
DROP TABLE IF EXISTS people;
|
||||
|
||||
DROP TYPE IF EXISTS mood CASCADE;
|
||||
|
||||
CREATE TYPE mood AS ENUM ( 'ok', 'happy', 'sad' );
|
||||
|
||||
EXCEPTION
|
||||
WHEN duplicate_object THEN null;
|
||||
END $$;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS people (
|
||||
CREATE TABLE people (
|
||||
id serial PRIMARY KEY,
|
||||
mood mood not null
|
||||
);
|
||||
|
||||
TRUNCATE people;
|
||||
"#,
|
||||
)
|
||||
.await?;
|
||||
|
|
Loading…
Reference in a new issue