summaryrefslogtreecommitdiffstats
path: root/database_pgsql.sql
diff options
context:
space:
mode:
authorOlivier Debauche <olivier.debauche@gmail.com>2015-11-01 10:26:02 +0100
committerOlivier Debauche <olivier.debauche@gmail.com>2015-11-01 10:26:02 +0100
commite5de36b26ce2ec18b6873a967b0cddc9794305c9 (patch)
tree7c13487b6cdd8739da25529ec4e85cbffb5c3eac /database_pgsql.sql
parentd73086e60757f2eac223a670a749253e2120eff5 (diff)
downloadPHPAuth-e5de36b26ce2ec18b6873a967b0cddc9794305c9.zip
PHPAuth-e5de36b26ce2ec18b6873a967b0cddc9794305c9.tar.gz
PHPAuth-e5de36b26ce2ec18b6873a967b0cddc9794305c9.tar.bz2
Rename db_pgsql to database_pgsql.sql
Diffstat (limited to 'database_pgsql.sql')
-rw-r--r--database_pgsql.sql87
1 files changed, 87 insertions, 0 deletions
diff --git a/database_pgsql.sql b/database_pgsql.sql
new file mode 100644
index 0000000..43462b5
--- /dev/null
+++ b/database_pgsql.sql
@@ -0,0 +1,87 @@
+DROP TABLE IF EXISTS config;
+CREATE TABLE config (
+ id serial NOT NULL,
+ setting character varying(100) NOT NULL,
+ value character varying(100) DEFAULT NULL,
+ PRIMARY KEY (id)
+);
+
+INSERT INTO config (id, setting, value) VALUES
+(1, 'site_name', 'PHPAuth'),
+(2, 'site_url', 'https://github.com/PHPAuth/PHPAuth'),
+(3, 'site_email', 'no-reply@phpauth.cuonic.com'),
+(4, 'site_key', 'fghuior.)/!/jdUkd8s2!7HVHG7777ghg'),
+(5, 'site_timezone', 'Europe/Paris'),
+(6, 'site_activation_page', 'activate'),
+(7, 'site_password_reset_page', 'reset'),
+(8, 'cookie_name', 'authID'),
+(9, 'cookie_path', '/'),
+(10, 'cookie_domain', NULL),
+(11, 'cookie_secure', '0'),
+(12, 'cookie_http', '0'),
+(13, 'cookie_remember', '+1 month'),
+(14, 'cookie_forget', '+30 minutes'),
+(15, 'bcrypt_cost', '10'),
+(16, 'table_attempts', 'attempts'),
+(17, 'table_requests', 'requests'),
+(18, 'table_sessions', 'sessions'),
+(19, 'table_users', 'users'),
+(20, 'smtp', '0'),
+(21, 'smtp_host', 'smtp.example.com'),
+(22, 'smtp_auth', '1'),
+(23, 'smtp_username', 'email@example.com'),
+(24, 'smtp_password', 'password'),
+(25, 'smtp_port', '25'),
+(26, 'smtp_security', NULL),
+(27, 'verify_password_min_length', '3'),
+(28, 'verify_password_max_length', '150'),
+(29, 'verify_password_strong_requirements', '1'),
+(30, 'verify_email_min_length', '5'),
+(31, 'verify_email_max_length', '100'),
+(32, 'verify_email_use_banlist', '1'),
+(33, 'attack_mitigation_time', '+30 minutes'),
+(34, 'attempts_before_verify', '5'),
+(35, 'attempts_before_ban', '30'),
+(36, 'emailmessage_suppress_activation', '0'),
+(37, 'emailmessage_suppress_reset', '0');
+
+DROP TABLE IF EXISTS attempts;
+CREATE TABLE attempts (
+ id serial NOT NULL,
+ ip character varying(39) NOT NULL,
+ expiredate timestamp without time zone NOT NULL,
+ PRIMARY KEY (id)
+);
+
+DROP TABLE IF EXISTS requests;
+CREATE TABLE requests (
+ id serial NOT NULL,
+ uid integer NOT NULL,
+ rkey character varying (20) NOT NULL,
+ expire character timestamp without time zone NOT NULL,
+ type character varying (20) NOT NULL,
+ PRIMARY KEY (id)
+);
+
+DROP TABLE IF EXISTS sessions;
+CREATE TABLE sessions (
+ id serial NOT NULL,
+ uid integer NOT NULL,
+ hash character varying(40) NOT NULL,
+ expiredate timestamp without time zone NOT NULL,
+ ip varying(39) NOT NULL,
+ agent character varying(200) NOT NULL,
+ cookie_crc character varying(40) NOT NULL,
+ PRIMARY KEY (id)
+);
+
+
+DROP TABLE IF EXISTS users;
+CREATE TABLE users (
+ id serial NOT NULLL,
+ email character varying(100) DEFAULT NULL,
+ password character varying(60) DEFAULT NULL,
+ isactive smallint NOT NULL DEFAULT '0',
+ dt timestamp without time zone NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ PRIMARY KEY (id)
+);