<commit_before>-- $Header: /home/sol/usr/cvs/reodb/create.sql,v 1.2 2007/08/31 11:16:18 sol Exp $

CREATE SEQUENCE "id" START 1000000;

CREATE TABLE obj (
	obj_id		integer		DEFAULT nextval('id') NOT NULL,
	class_id	integer		NOT NULL,
	label		text		DEFAULT '' NOT NULL,
	descr		text		DEFAULT '' NOT NULL,
	create_time	timestamp	DEFAULT now() NOT NULL,
	update_time	timestamp	DEFAULT now() NOT NULL
);
SELECT now()::timestamp without time zone AS old_time,* INTO old_obj FROM obj limit 0;

CREATE TABLE ref (
	obj_id		integer		NOT NULL,
	_id		integer		NOT NULL,
	name		text		DEFAULT '' NOT NULL,
	no		integer		DEFAULT 0 NOT NULL
);
SELECT * INTO del_ref FROM ref LIMIT 0;

CREATE TABLE prop (
	obj_id		integer		NOT NULL,
	class_id	integer		NOT NULL,
	name		text		NOT NULL,
	type_id		integer		NOT NULL,
	no		integer		DEFAULT 0 NOT NULL,
	def		text		NULL,
	is_t		boolean		DEFAULT FALSE NOT NULL,
	is_n		boolean		DEFAULT FALSE NOT NULL,
	is_s		boolean		DEFAULT FALSE NOT NULL,
	is_r		boolean		DEFAULT FALSE NOT NULL
);
SELECT * INTO del_prop FROM prop LIMIT 0;

CREATE TABLE value (
	id		integer		NOT NULL DEFAULT nextval('id'),
	obj_id		integer		NOT NULL,
	prop_id		integer		NOT NULL,
	no		integer		DEFAULT 0 NOT NULL,
	value		text		DEFAULT '' NOT NULL
);
SELECT * INTO del_value FROM value LIMIT 0;

CREATE TABLE user_value (
	id		integer		NOT NULL DEFAULT nextval('id'),
	obj_id		integer		NOT NULL,
	user_id		integer		NOT NULL,
	prop_id		integer		NOT NULL,
	no		integer		DEFAULT 0 NOT NULL,
	value		text		DEFAULT '' NOT NULL<commit_msg>+ old_value<commit_after>-- $Header: /home/sol/usr/cvs/reodb/create.sql,v 1.2 2007/08/31 11:16:18 sol Exp $

CREATE SEQUENCE "id" START 1000000;

CREATE TABLE obj (
	obj_id		integer		DEFAULT nextval('id') NOT NULL,
	class_id	integer		NOT NULL,
	label		text		DEFAULT '' NOT NULL,
	descr		text		DEFAULT '' NOT NULL,
	create_time	timestamp	DEFAULT now() NOT NULL,
	update_time	timestamp	DEFAULT now() NOT NULL
);
SELECT now()::timestamp without time zone AS old_time,* INTO old_obj FROM obj limit 0;

CREATE TABLE ref (
	obj_id		integer		NOT NULL,
	_id		integer		NOT NULL,
	name		text		DEFAULT '' NOT NULL,
	no		integer		DEFAULT 0 NOT NULL
);
SELECT * INTO del_ref FROM ref LIMIT 0;

CREATE TABLE prop (
	obj_id		integer		NOT NULL,
	class_id	integer		NOT NULL,
	name		text		NOT NULL,
	type_id		integer		NOT NULL,
	no		integer		DEFAULT 0 NOT NULL,
	def		text		NULL,
	is_t		boolean		DEFAULT FALSE NOT NULL,
	is_n		boolean		DEFAULT FALSE NOT NULL,
	is_s		boolean		DEFAULT FALSE NOT NULL,
	is_r		boolean		DEFAULT FALSE NOT NULL
);
SELECT * INTO del_prop FROM prop LIMIT 0;

CREATE TABLE value (
	id		integer		NOT NULL DEFAULT nextval('id'),
	obj_id		integer		NOT NULL,
	prop_id		integer		NOT NULL,
	no		integer		DEFAULT 0 NOT NULL,
	value		text		DEFAULT '' NOT NULL
);
SELECT * INTO del_value FROM value LIMIT 0;

CREATE TABLE old_value (
	obj_id		integer,
	prop_id		integer,
	no		integer,
	value		text,
	old_time	timestamp,
	user_id		integer
);

CREATE TABLE user_value (
	id		integer		NOT NULL DEFAULT nextval('id'),
	obj_id		integer		NOT NULL,
	user_id		integer		NOT NULL,
	prop_id		integer		NOT NULL,
	no		integer		DEFAULT 0 NOT NULL,
	value		text		DEFAULT '' NOT NULL
{'fraction_non_alphanumeric': 0.0665833072835261, 'fraction_numerical': 0.019381056580181306, 'mean_word_length': 3.526166902404526, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1002788', 'n_tokens_mistral': 1268, 'n_tokens_neox': 1207, 'n_words': 447}