aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-01-11 11:58:16 -0800
committerBryan Newbold <bnewbold@robocracy.org>2019-01-11 11:58:16 -0800
commit22c85fa299438b64e65c422b677c0c97fc2b5ef6 (patch)
treea92404ae2a118ea73bc0327b370e85522601259f
parentfb80d1dbe88614a53b7fd4e61b08b5e1cd296c7e (diff)
downloadfatcat-22c85fa299438b64e65c422b677c0c97fc2b5ef6.tar.gz
fatcat-22c85fa299438b64e65c422b677c0c97fc2b5ef6.zip
minor SQL schema tweaks (column order and extra indexes)
-rw-r--r--rust/migrations/2019-01-01-000000_init/up.sql7
-rw-r--r--rust/src/database_schema.rs2
2 files changed, 5 insertions, 4 deletions
diff --git a/rust/migrations/2019-01-01-000000_init/up.sql b/rust/migrations/2019-01-01-000000_init/up.sql
index 30af7879..e6257f8d 100644
--- a/rust/migrations/2019-01-01-000000_init/up.sql
+++ b/rust/migrations/2019-01-01-000000_init/up.sql
@@ -47,8 +47,8 @@ CREATE TABLE editgroup (
created TIMESTAMP WITH TIME ZONE DEFAULT now() NOT NULL,
submitted TIMESTAMP WITH TIME ZONE,
is_accepted BOOLEAN DEFAULT false NOT NULL,
- extra_json JSONB,
- description TEXT
+ description TEXT,
+ extra_json JSONB
);
-- for fast "recent, reviewable" and "work in progress" queries
@@ -64,7 +64,8 @@ CREATE TABLE editgroup_annotation (
extra_json JSONB
);
-CREATE INDEX editgroup_annotation_created_idx ON editgroup_annotation(editgroup_id, created);
+CREATE INDEX editgroup_annotation_editgroup_created_idx ON editgroup_annotation(editgroup_id, created);
+CREATE INDEX editgroup_annotation_editor_created_idx ON editgroup_annotation(editor_id, created);
CREATE TABLE changelog (
id BIGSERIAL PRIMARY KEY,
diff --git a/rust/src/database_schema.rs b/rust/src/database_schema.rs
index b82e776f..3bc57d95 100644
--- a/rust/src/database_schema.rs
+++ b/rust/src/database_schema.rs
@@ -100,8 +100,8 @@ table! {
created -> Timestamptz,
submitted -> Nullable<Timestamptz>,
is_accepted -> Bool,
- extra_json -> Nullable<Jsonb>,
description -> Nullable<Text>,
+ extra_json -> Nullable<Jsonb>,
}
}