-- SQLITE Database creation script

-- --------------------------------------------------------
--
-- Table structure for table `admin_table`
-- 

CREATE TABLE admin_table ( 
	 comment_admin 	text, 
	 date_admin 	numeric NOT NULL, 
	 include_sources_admin 	text, 
	 included_admin 	numeric, 
	 info_admin 	text, 
	 list_admin 	text NOT NULL, 
	 profile_admin 	text, 
	 reception_admin 	text, 
	 robot_admin 	text NOT NULL, 
	 role_admin 	text NOT NULL, 
	 subscribed_admin 	numeric, 
	 update_admin 	numeric, 
	 user_admin 	text NOT NULL, 
	 visibility_admin 	text, 
	 PRIMARY KEY (robot_admin, list_admin, role_admin, user_admin) 
 );

CREATE INDEX admin_user_index ON admin_table ( user_admin ); 


-- --------------------------------------------------------
--
-- Table structure for table `bulkmailer_table`
-- 

CREATE TABLE bulkmailer_table ( 
	 delivery_date_bulkmailer 	integer, 
	 listname_bulkmailer 	text, 
	 lock_bulkmailer 	text, 
	 merge_bulkmailer 	numeric, 
	 messageid_bulkmailer 	text, 
	 messagekey_bulkmailer 	text NOT NULL, 
	 packetid_bulkmailer 	text NOT NULL, 
	 priority_message_bulkmailer 	integer, 
	 priority_packet_bulkmailer 	integer, 
	 receipients_bulkmailer 	text, 
	 reception_date_bulkmailer 	integer, 
	 returnpath_bulkmailer 	text, 
	 robot_bulkmailer 	text, 
	 verp_bulkmailer 	numeric, 
	 PRIMARY KEY (messagekey_bulkmailer, packetid_bulkmailer) 
 );


-- --------------------------------------------------------
--
-- Table structure for table `bulkspool_table`
-- 

CREATE TABLE bulkspool_table ( 
	 dkim_d_bulkspool 	text, 
	 dkim_i_bulkspool 	text, 
	 dkim_privatekey_bulkspool 	text, 
	 dkim_selector_bulkspool 	text, 
	 lock_bulkspool 	numeric, 
	 message_bulkspool 	text, 
	 messageid_bulkspool 	text, 
	 messagekey_bulkspool 	text NOT NULL, 
	 PRIMARY KEY (messagekey_bulkspool) 
 );


-- --------------------------------------------------------
--
-- Table structure for table `conf_table`
-- 

CREATE TABLE conf_table ( 
	 label_conf 	text, 
	 robot_conf 	text, 
	 value_conf 	text, 
	 PRIMARY KEY (robot_conf, label_conf) 
 );


-- --------------------------------------------------------
--
-- Table structure for table `exclusion_table`
-- 

CREATE TABLE exclusion_table ( 
	 date_exclusion 	integer, 
	 family_exclusion 	text, 
	 list_exclusion 	text NOT NULL, 
	 robot_exclusion 	text NOT NULL, 
	 user_exclusion 	text NOT NULL, 
	 PRIMARY KEY (list_exclusion, user_exclusion, robot_exclusion) 
 );


-- --------------------------------------------------------
--
-- Table structure for table `list_table`
-- 

CREATE TABLE list_table ( 
	 creation_email_list 	text, 
	 creation_epoch_list 	numeric, 
	 editors_list 	text, 
	 name_list 	text NOT NULL, 
	 owners_list 	text, 
	 path_list 	text, 
	 robot_list 	text NOT NULL, 
	 status_list 	text, 
	 subject_list 	text, 
	 topics_list 	text, 
	 web_archive_list 	numeric, 
	 PRIMARY KEY (name_list, robot_list) 
 );


-- --------------------------------------------------------
--
-- Table structure for table `logs_table`
-- 

CREATE TABLE logs_table ( 
	 action_logs 	text NOT NULL, 
	 client_logs 	text, 
	 daemon_logs 	text NOT NULL, 
	 date_logs 	integer NOT NULL, 
	 error_type_logs 	text, 
	 id_logs 	integer NOT NULL, 
	 list_logs 	text, 
	 msg_id_logs 	text, 
	 parameters_logs 	text, 
	 robot_logs 	text, 
	 status_logs 	text NOT NULL, 
	 target_email_logs 	text, 
	 user_email_logs 	text, 
	 PRIMARY KEY (id_logs) 
 );


-- --------------------------------------------------------
--
-- Table structure for table `netidmap_table`
-- 

CREATE TABLE netidmap_table ( 
	 email_netidmap 	text, 
	 netid_netidmap 	text NOT NULL, 
	 robot_netidmap 	text NOT NULL, 
	 serviceid_netidmap 	text NOT NULL, 
	 PRIMARY KEY (netid_netidmap, serviceid_netidmap, robot_netidmap) 
 );


-- --------------------------------------------------------
--
-- Table structure for table `one_time_ticket_table`
-- 

CREATE TABLE one_time_ticket_table ( 
	 data_one_time_ticket 	text, 
	 date_one_time_ticket 	integer, 
	 email_one_time_ticket 	text, 
	 remote_addr_one_time_ticket 	text, 
	 robot_one_time_ticket 	text, 
	 status_one_time_ticket 	text, 
	 ticket_one_time_ticket 	text, 
	 PRIMARY KEY (ticket_one_time_ticket) 
 );


-- --------------------------------------------------------
--
-- Table structure for table `session_table`
-- 

CREATE TABLE session_table ( 
	 data_session 	text, 
	 date_session 	integer NOT NULL, 
	 email_session 	text, 
	 hit_session 	integer, 
	 id_session 	text NOT NULL, 
	 prev_id_session 	text, 
	 refresh_date_session 	integer, 
	 remote_addr_session 	text, 
	 robot_session 	text, 
	 start_date_session 	integer NOT NULL, 
	 PRIMARY KEY (id_session) 
 );


-- --------------------------------------------------------
--
-- Table structure for table `subscriber_table`
-- 

CREATE TABLE subscriber_table ( 
	 bounce_address_subscriber 	text, 
	 bounce_score_subscriber 	integer, 
	 bounce_subscriber 	text, 
	 comment_subscriber 	text, 
	 custom_attribute_subscriber 	text, 
	 date_subscriber 	numeric NOT NULL, 
	 include_sources_subscriber 	text, 
	 included_subscriber 	numeric, 
	 list_subscriber 	text NOT NULL, 
	 reception_subscriber 	text, 
	 robot_subscriber 	text NOT NULL, 
	 subscribed_subscriber 	numeric, 
	 suspend_end_date_subscriber 	integer, 
	 suspend_start_date_subscriber 	integer, 
	 suspend_subscriber 	numeric, 
	 topics_subscriber 	text, 
	 update_subscriber 	numeric, 
	 user_subscriber 	text NOT NULL, 
	 visibility_subscriber 	text, 
	 PRIMARY KEY (robot_subscriber, list_subscriber, user_subscriber) 
 );

CREATE INDEX subscriber_user_index ON subscriber_table ( user_subscriber ); 


-- --------------------------------------------------------
--
-- Table structure for table `user_table`
-- 

CREATE TABLE user_table ( 
	 attributes_user 	text, 
	 cookie_delay_user 	integer, 
	 data_user 	text, 
	 email_user 	text NOT NULL, 
	 gecos_user 	text, 
	 lang_user 	text, 
	 last_login_date_user 	integer, 
	 last_login_host_user 	text, 
	 password_user 	text, 
	 wrong_login_count_user 	integer, 
	 PRIMARY KEY (email_user) 
 );
