20221114124500_add_place_image_table.sql 383 B

1234567891011121314
  1. -- +goose Up
  2. CREATE TABLE place_image
  3. (
  4. id SERIAL PRIMARY KEY,
  5. place_id INT NOT NULL,
  6. image TEXT NOT NULL,
  7. created_at TIMESTAMP NOT NULL DEFAULT NOW(),
  8. CONSTRAINT fk_place_image_place_id FOREIGN KEY (place_id) REFERENCES place (id)
  9. );
  10. CREATE INDEX idx_place_image_place ON place_image (place_id);
  11. -- +goose Down
  12. DROP TABLE place_image;