test(postgres): make test_enum_type more resilient

This commit is contained in:
Ryan Leckey 2020-04-10 14:22:18 -07:00
parent d360f682f8
commit 52408f3cbf

View File

@ -78,20 +78,17 @@ async fn test_enum_type() -> anyhow::Result<()> {
conn.execute( conn.execute(
r#" r#"
DO $$ BEGIN
DROP TABLE IF EXISTS people;
DROP TYPE IF EXISTS mood CASCADE;
CREATE TYPE mood AS ENUM ( 'ok', 'happy', 'sad' ); CREATE TYPE mood AS ENUM ( 'ok', 'happy', 'sad' );
EXCEPTION CREATE TABLE people (
WHEN duplicate_object THEN null;
END $$;
CREATE TABLE IF NOT EXISTS people (
id serial PRIMARY KEY, id serial PRIMARY KEY,
mood mood not null mood mood not null
); );
TRUNCATE people;
"#, "#,
) )
.await?; .await?;