MarseyWorld/sql/20221006-media-table.sql

14 lines
411 B
MySQL
Raw Normal View History

2022-10-06 05:54:04 +00:00
CREATE TABLE public.media (
kind character varying(5) NOT NULL,
filename character varying(23) NOT NULL,
user_id Integer NOT NULL,
created_utc integer NOT NULL,
size integer NOT NULL
);
ALTER TABLE ONLY public.media
ADD CONSTRAINT media_pkey PRIMARY KEY (kind, filename);
ALTER TABLE ONLY public.media
ADD CONSTRAINT media_user_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);