create extension "uuid-ossp";

create table users (
	id uuid not null primary key default gen_random_uuid(),
	created_at timestamptz not null default current_timestamp,
	updated_at timestamptz,

	username varchar(256) not null,
	password varchar(512) not null,

	enabled boolean not null default true
);

insert into users (id, username, password)
values ('00000000-0000-0000-0000-000000000000', 'legacy', '');

alter table doll_profiles
	add column bound_to_id uuid not null
		default '00000000-0000-0000-0000-000000000000'
		references users (id)
		on delete cascade;

alter table doll_profiles
	alter column bound_to_id drop default;
