Compare commits
2 Commits
f0bd89759c
...
5aa1542074
Author | SHA1 | Date | |
---|---|---|---|
5aa1542074 | |||
ccb7cff4fc |
@ -17,14 +17,14 @@ CREATE TYPE TagType AS ENUM (
|
|||||||
|
|
||||||
CREATE TABLE "Post"
|
CREATE TABLE "Post"
|
||||||
(
|
(
|
||||||
id VARCHAR(25) PRIMARY KEY,
|
id VARCHAR(25) UNIQUE PRIMARY KEY,
|
||||||
rating Rating,
|
rating Rating,
|
||||||
created_at TIMESTAMP
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE "Source"
|
CREATE TABLE "Source"
|
||||||
(
|
(
|
||||||
id VARCHAR(25) PRIMARY KEY,
|
id VARCHAR(25) UNIQUE PRIMARY KEY,
|
||||||
display_name TEXT,
|
display_name TEXT,
|
||||||
domain TEXT NOT NULL UNIQUE
|
domain TEXT NOT NULL UNIQUE
|
||||||
);
|
);
|
||||||
@ -37,8 +37,8 @@ CREATE TABLE "Tag"
|
|||||||
|
|
||||||
CREATE TABLE "User"
|
CREATE TABLE "User"
|
||||||
(
|
(
|
||||||
id TEXT PRIMARY KEY,
|
id TEXT UNIQUE PRIMARY KEY,
|
||||||
created_at TIMESTAMP
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE "PostReference"
|
CREATE TABLE "PostReference"
|
||||||
@ -66,7 +66,7 @@ CREATE TABLE "UserFavorites"
|
|||||||
(
|
(
|
||||||
user_id TEXT REFERENCES "User" (id),
|
user_id TEXT REFERENCES "User" (id),
|
||||||
post_id TEXT REFERENCES "Post" (id),
|
post_id TEXT REFERENCES "Post" (id),
|
||||||
created_at TIMESTAMP,
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
PRIMARY KEY (user_id, post_id)
|
PRIMARY KEY (user_id, post_id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ func NewPostgresqlConnection() OtterSpace {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p postgresqlConnection) Connect(ctx context.Context, endpoint string, username string, password string, database string, port int, ssl string, timezone string) error {
|
func (p postgresqlConnection) Connect(_ context.Context, endpoint string, username string, password string, database string, port int, ssl string, timezone string) error {
|
||||||
dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=%s TimeZone=%s", endpoint, username, password, database, port, ssl, timezone)
|
dsn := fmt.Sprintf("host=%s user=%s password=%s dbname=%s port=%d sslmode=%s TimeZone=%s", endpoint, username, password, database, port, ssl, timezone)
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user