aboutsummaryrefslogtreecommitdiff
path: root/roomserver/storage/postgres/published_table.go
diff options
context:
space:
mode:
Diffstat (limited to 'roomserver/storage/postgres/published_table.go')
-rw-r--r--roomserver/storage/postgres/published_table.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/roomserver/storage/postgres/published_table.go b/roomserver/storage/postgres/published_table.go
index 440ae784..c180576e 100644
--- a/roomserver/storage/postgres/published_table.go
+++ b/roomserver/storage/postgres/published_table.go
@@ -50,12 +50,14 @@ type publishedStatements struct {
selectPublishedStmt *sql.Stmt
}
-func NewPostgresPublishedTable(db *sql.DB) (tables.Published, error) {
- s := &publishedStatements{}
+func createPublishedTable(db *sql.DB) error {
_, err := db.Exec(publishedSchema)
- if err != nil {
- return nil, err
- }
+ return err
+}
+
+func preparePublishedTable(db *sql.DB) (tables.Published, error) {
+ s := &publishedStatements{}
+
return s, shared.StatementList{
{&s.upsertPublishedStmt, upsertPublishedSQL},
{&s.selectAllPublishedStmt, selectAllPublishedSQL},