 
 CREATE TABLE public.bundle_context (
   id                  INTEGER   NOT NULL DEFAULT nextval('public.bundle_context_id_seq'),
-  parent_bundle_id    INTEGER,
   date_created        TIMESTAMP NOT NULL,
   last_updated        TIMESTAMP NOT NULL,
   name                VARCHAR   NOT NULL,
+  parent_bundle_id    INTEGER,
   entity_selection_id INTEGER   NOT NULL,
   CONSTRAINT bundle_context_bundle_pk PRIMARY KEY (id)
 );


ALTER SEQUENCE public.bundle_propertyrecord_crossref_id_seq OWNED BY public.bundle_propertyrecord_crossref.id;

CREATE SEQUENCE public.bundle_propertylice_id_seq;

CREATE TABLE public.bundle_propertylice (
  id                                INTEGER NOT NULL DEFAULT nextval('public.bundle_propertylice_id_seq'),
  name                              VARCHAR NOT NULL,
  bundle_propertyrecord_crossref_id INTEGER NOT NULL,
  CONSTRAINT bundle_propertylice_pk PRIMARY KEY (id)
);


ALTER SEQUENCE public.bundle_propertylice_id_seq OWNED BY public.bundle_propertylice.id;

CREATE SEQUENCE public.bundle_propertylicecondition_id_seq;

CREATE TABLE public.bundle_propertylicecondition (
  id               INTEGER NOT NULL DEFAULT nextval('public.bundle_propertylicecondition_id_seq'),
  propertyslice_id INTEGER NOT NULL,
  operator         VARCHAR NOT NULL,
  value            VARCHAR NOT NULL,
  CONSTRAINT bundle_propertylicecondition_pk PRIMARY KEY (id)
);


ALTER SEQUENCE public.bundle_propertylicecondition_id_seq OWNED BY public.bundle_propertylicecondition.id;

CREATE SEQUENCE public.locations_systempropertystaticcrossref_id_seq;


ON UPDATE NO ACTION
NOT DEFERRABLE;

ALTER TABLE public.bundle_propertyslice ADD CONSTRAINT bundle_propertyrecord_crossref_contextual_bundlepropertyslic823
FOREIGN KEY (bundle_propertyrecord_crossref_id)
REFERENCES public.bundle_propertyrecord_crossref (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
NOT DEFERRABLE;

ALTER TABLE public.bundle_propertyslicecondition ADD CONSTRAINT bundle_propertyslice_bundle_propertyslicecondition_fk
FOREIGN KEY (propertyslice_id)
REFERENCES public.bundle_propertyslice (id)
ON DELETE NO ACTION
ON UPDATE NO ACTION
NOT DEFERRABLE;
