mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-30 05:11:13 +00:00
I think postgres needs this
This commit is contained in:
parent
2ffbe2f06e
commit
03ba5ca434
@ -30,6 +30,7 @@ enum Strong {
|
||||
|
||||
// rename_all variants
|
||||
#[derive(PartialEq, Debug, sqlx::Type)]
|
||||
#[sqlx(rename = "color_lower")]
|
||||
#[sqlx(rename_all = "lowercase")]
|
||||
enum ColorLower {
|
||||
Red,
|
||||
@ -37,12 +38,14 @@ enum ColorLower {
|
||||
Blue,
|
||||
}
|
||||
#[derive(PartialEq, Debug, sqlx::Type)]
|
||||
#[sqlx(rename = "color_snake")]
|
||||
#[sqlx(rename_all = "snake_case")]
|
||||
enum ColorSnake {
|
||||
RedGreen,
|
||||
BlueBlack,
|
||||
}
|
||||
#[derive(PartialEq, Debug, sqlx::Type)]
|
||||
#[sqlx(rename = "color_upper")]
|
||||
#[sqlx(rename_all = "uppercase")]
|
||||
enum ColorUpper {
|
||||
Red,
|
||||
@ -123,6 +126,14 @@ DROP TYPE IF EXISTS mood CASCADE;
|
||||
|
||||
CREATE TYPE mood AS ENUM ( 'ok', 'happy', 'sad' );
|
||||
|
||||
DROP TYPE IF EXISTS color_lower CASCADE;
|
||||
DROP TYPE IF EXISTS color_snake CASCADE;
|
||||
DROP TYPE IF EXISTS color_upper CASCADE;
|
||||
|
||||
CREATE TYPE color_lower AS ENUM ( 'red', 'green', 'blue' );
|
||||
CREATE TYPE color_snake AS ENUM ( 'red_green', 'blue_black' );
|
||||
CREATE TYPE color_upper AS ENUM ( 'RED', 'GREEN', 'BLUE' );
|
||||
|
||||
CREATE TABLE people (
|
||||
id serial PRIMARY KEY,
|
||||
mood mood not null
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user