Skip to content

CreateTable

MSugiura edited this page Dec 27, 2023 · 1 revision

You can create a table from a Model.

The table creation command uses the "if exists" keyword, so there is no harm in running it multiple times.

cn.CreateTableOrDefault<Blog>();
create table if not exists blogs (
    blog_id serial8 not null, 
    url text not null, 
    primary key(blog_id)
)
;
create unique index if not exists i1_blogs on blogs (url)
;

Constraints

Migration of table structure changes is not supported.

Clone this wiki locally