mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-10-02 15:25:32 +00:00
test(postgres): make test_enum_type more resilient
This commit is contained in:
parent
d360f682f8
commit
52408f3cbf
@ -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…
x
Reference in New Issue
Block a user