Skip to content

Instantly share code, notes, and snippets.

@dschulz
Last active May 1, 2022 21:55
Show Gist options
  • Save dschulz/3a850aa0248a687dabcd20d812aab331 to your computer and use it in GitHub Desktop.
Save dschulz/3a850aa0248a687dabcd20d812aab331 to your computer and use it in GitHub Desktop.
begin transaction ;
drop schema restapi cascade;
create schema restapi;
commit;
begin transaction ;
--drop table if exists restapi.todos;
create table if not exists restapi.todos (
id bigint GENERATED ALWAYS AS IDENTITY (MINVALUE 0 START WITH 0 CACHE 20) PRIMARY KEY,
"uuid" uuid not null,
done boolean not null default false,
task text not null,
due timestamptz
);
insert into restapi.todos (task, uuid) values
('finish tutorial 0', gen_random_uuid() ), ('pat self on back', gen_random_uuid());
commit;
select * from restapi.todos;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment