 
 CREATE TABLE memory_assets (
     id integer NOT NULL,
-    memory_id integer,
+    memory_id int not null references memories(id),
     asset_type character varying NOT NULL,
     asset_url text NOT NULL,
     created_at timestamp without time zone NOT NULL,



--
-- Name: memories id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY memories ALTER COLUMN id SET DEFAULT nextval('memories_id_seq'::regclass);


--
-- Name: memory_assets id; Type: DEFAULT; Schema: public; Owner: -
--




--
-- Name: memories id; Type: DEFAULT; Schema: public; Owner: -
--

ALTER TABLE ONLY memories ALTER COLUMN id SET DEFAULT nextval('memories_id_seq'::regclass);

--
-- Name: memories memories_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--

ALTER TABLE ONLY memories
    ADD CONSTRAINT memories_pkey PRIMARY KEY (id);

--
-- Name: memories_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
--

