mirror of
https://github.com/pressly/goose.git
synced 2025-05-22 15:29:53 +00:00
16 lines
272 B
SQL
16 lines
272 B
SQL
-- +goose NO TRANSACTION
|
|
|
|
-- +goose Up
|
|
CREATE VIEW posts_view AS
|
|
SELECT
|
|
p.id,
|
|
p.title,
|
|
p.content,
|
|
p.created_at,
|
|
u.username AS author
|
|
FROM posts p
|
|
JOIN users u ON p.author_id = u.id;
|
|
|
|
-- +goose Down
|
|
DROP VIEW posts_view;
|