20221114125200_add_thing_image_table.sql 383 B

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