18 lines
419 B
SQL
18 lines
419 B
SQL
-- +goose Up
|
|
-- +goose StatementBegin
|
|
CREATE TABLE agent (
|
|
id UUID NOT NULL DEFAULT generate_ulid(),
|
|
machine_id UUID NOT NULL,
|
|
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
|
|
PRIMARY KEY(id),
|
|
FOREIGN KEY (machine_id) REFERENCES machine(id)
|
|
);
|
|
CREATE INDEX idx_agent_machine_id ON agent(machine_id);
|
|
-- +goose StatementEnd
|
|
|
|
-- +goose Down
|
|
-- +goose StatementBegin
|
|
DROP TABLE agent;
|
|
-- +goose StatementEnd
|