is_staff BOOLEAN NOT NULL,
is_active BOOLEAN NOT NULL,
date_joined TIMESTAMP with time zone DEFAULT now() NOT NULL,
+ forgot_password_uuid TEXT,
PRIMARY KEY (id)
);
ALTER TABLE public.auth_user OWNER TO gargantua;
ngrams_id INTEGER NOT NULL REFERENCES public.ngrams (id) ON DELETE CASCADE,
ngrams_type INTEGER ,
weight double precision,
+ doc_count INTEGER DEFAULT 0,
PRIMARY KEY (context_id, node_id, ngrams_id, ngrams_type)
);
ALTER TABLE public.context_node_ngrams OWNER TO gargantua;
ALTER TABLE public.rights OWNER TO gargantua;
------------------------------------------------------------
+-- Node Story
+
+CREATE TABLE public.node_stories (
+ id SERIAL,
+ node_id INTEGER NOT NULL,
+ version INTEGER NOT NULL,
+ ngrams_type_id INTEGER NOT NULL,
+ ngrams_id INTEGER NOT NULL,
+ --children TEXT[],
+ ngrams_repo_element jsonb DEFAULT '{}'::jsonb NOT NULL,
+ PRIMARY KEY (id),
+ FOREIGN KEY (node_id) REFERENCES public.nodes(id) ON DELETE CASCADE,
+ FOREIGN KEY (ngrams_id) REFERENCES public.ngrams(id) ON DELETE CASCADE
+);
+ALTER TABLE public.node_stories OWNER TO gargantua;
+
+CREATE UNIQUE INDEX ON public.node_stories USING btree (node_id, ngrams_type_id, ngrams_id);
+
+
+create table public.node_story_archive_history (
+ id SERIAL,
+ node_id INTEGER NOT NULL,
+ ngrams_type_id INTEGER NOT NULL,
+ ngrams_id INTEGER NOT NULL,
+ patch jsonb DEFAULT '{}'::jsonb NOT NULL,
+ version INTEGER NOT NULL DEFAULT 0,
+ PRIMARY KEY (id),
+ FOREIGN KEY (node_id) REFERENCES public.nodes(id) ON DELETE CASCADE,
+ FOREIGN KEY (ngrams_id) REFERENCES public.ngrams(id) ON DELETE CASCADE
+);
+ALTER TABLE public.node_story_archive_history OWNER TO gargantua;
+
+
------------------------------------------------------------
-- INDEXES
CREATE INDEX ON public.auth_user USING btree (username varchar_pattern_ops);
--drop index node_by_pos;
--create index node_by_pos on nodes using btree(node_pos(id,typename));
-