-- Table: alf_node_properties

-- DROP TABLE alf_node_properties;

CREATE TABLE alf_node_properties
(
  node_id bigint NOT NULL,
  actual_type_n integer NOT NULL,
  persisted_type_n integer NOT NULL,
  boolean_value boolean,
  long_value bigint,
  float_value real,
  double_value double precision,
  string_value character varying(1024),
  serializable_value bytea,
  qname_id bigint NOT NULL,
  list_index integer NOT NULL,
  locale_id bigint NOT NULL,
  CONSTRAINT alf_node_properties_pkey PRIMARY KEY (node_id, qname_id, list_index, locale_id),
  CONSTRAINT fk_alf_nprop_loc FOREIGN KEY (locale_id)
      REFERENCES alf_locale (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT fk_alf_nprop_n FOREIGN KEY (node_id)
      REFERENCES alf_node (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION,
  CONSTRAINT fk_alf_nprop_qn FOREIGN KEY (qname_id)
      REFERENCES alf_qname (id) MATCH SIMPLE
      ON UPDATE NO ACTION ON DELETE NO ACTION
)
WITH (
  FILLFACTOR=90, 
  OIDS=FALSE
);
ALTER TABLE alf_node_properties
  OWNER TO alfresco;

-- Index: fk_alf_nprop_loc

-- DROP INDEX fk_alf_nprop_loc;

CREATE INDEX fk_alf_nprop_loc
  ON alf_node_properties
  USING btree
  (locale_id);

-- Index: fk_alf_nprop_n

-- DROP INDEX fk_alf_nprop_n;

CREATE INDEX fk_alf_nprop_n
  ON alf_node_properties
  USING btree
  (node_id);

-- Index: fk_alf_nprop_qn

-- DROP INDEX fk_alf_nprop_qn;

CREATE INDEX fk_alf_nprop_qn
  ON alf_node_properties
  USING btree
  (qname_id);

