Skip to content

Support capital type definition in .sql? #2188

@ZichaoNickFox

Description

@ZichaoNickFox

Now I have to use lowercase to define type as

-- Your database schema. Use the Schema Designer at http://localhost:8001/ to add some tables.
CREATE TYPE node_type AS ENUM ('folder', 'file');
CREATE TYPE cell_type AS ENUM ('raw', 'image', 'backtest');
CREATE TYPE symbol_type AS ENUM ('stock', 'etf', 'future', 'option', 'fund');
CREATE TABLE symbol (
    id UUID DEFAULT uuid_generate_v4() PRIMARY KEY NOT NULL,
    code TEXT NOT NULL,
    name TEXT NOT NULL,
    symbol_type symbol_type NOT NULL,
    list_date TIMESTAMP WITHOUT TIME ZONE NOT NULL,
    delist_date TIMESTAMP WITHOUT TIME ZONE,
    UNIQUE(code, symbol_type)
);

If I use CREATE TYPE "SYMBOL_TYPE" AS ENUM ('stock', 'etf', 'future', 'option', 'fund') to define enum type. I have to write symbol_type "SYMBOL_TYPE" NOT NULL in creating symbol table. And there will be an error as follow when I enter localhost:8001.
Image

If I write symbol_type SYMBOL_TYPE NOT NULL without "". ihp-migration will treat SYMBOL_TYPE as lowercase symbol_type. This will generate a new migration to lowercase definition.

Using lowercase to define type is OK in everywhere. But using capital to define type is more better to uniform type definition of database. Do you have any plan to support using capital to define database type?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions