Dan Passaro
0
Q:

create table postgresql foreign key

alter table links_chatpicmessage 
      add column sender integer, 
      add constraint fk_test 
      foreign key (sender) 
      references auth_user (id);
0
CREATE TABLE so_items (
	so_id INTEGER,
  	...
	FOREIGN KEY (so_id) REFERENCES so_headers (id)
);
0
CREATE TABLE TABLE (
	column_1 data_type PRIMARY KEY,
	column_2 data_type,
	…
);
0

New to Communities?

Join the community