DEGTEVUWU/java-project-72

View on GitHub
app/src/main/resources/schema.sql

Summary

Maintainability
Test Coverage
DROP TABLE IF EXISTS urls CASCADE;
DROP TABLE IF EXISTS url_checks;

CREATE TABLE urls (
    id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
    name VARCHAR(255) NOT NULL,
    created_at Timestamp NOT NULL,
    CONSTRAINT pk_url PRIMARY KEY (id)

);



CREATE TABLE url_checks (
    id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL,
    url_id BIGINT REFERENCES urls(id) NOT NULL,
    status_code BIGINT,
    title TEXT,
    h1 VARCHAR(255),
    description TEXT,
    created_at Timestamp NOT NULL,
    CONSTRAINT pk_url_checks PRIMARY KEY (id)

);