From dbb0a0283f8398d02d2be92dab182ee5103b3651 Mon Sep 17 00:00:00 2001
From: redmatrix <git@macgirvin.com>
Date: Sat, 18 Jun 2016 15:33:47 -0700
Subject: schema changes needed for the caldav client bit

---
 install/schema_postgres.sql | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

(limited to 'install/schema_postgres.sql')

diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index b637fea43..9473252e6 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -193,6 +193,26 @@ CREATE TABLE "cache" (
   "updated" timestamp NOT NULL,
   PRIMARY KEY ("k")
 );
+CREATE TABLE "cal" (
+  "cal_id" serial  NOT NULL,
+  "cal_aid" bigint NOT NULL DEFAULT '0',
+  "cal_uid" bigint NOT NULL DEFAULT '0',
+  "cal_hash" text NOT NULL,
+  "cal_name" text NOT NULL,
+  "uri" text NOT NULL,
+  "logname" text NOT NULL,
+  "pass" text NOT NULL,
+  "ctag" text NOT NULL,
+  "synctoken" text NOT NULL,
+  "cal_types" text NOT NULL DEFAULT "0",
+  PRIMARY KEY ("cal_id")
+);
+create index "cal_hash_idx" on cal ("cal_hash");
+create index "cal_name_idx" on cal ("cal_name");
+create index "cal_types_idx" on cal ("cal_types");
+create index "cal_aid_idx" on cal ("cal_aid");
+create index "cal_uid_idx" on cal ("cal_uid");
+
 CREATE TABLE "channel" (
   "channel_id" serial  NOT NULL,
   "channel_account_id" bigint  NOT NULL DEFAULT '0',
@@ -380,14 +400,11 @@ create index "dreport_xchan" on dreport ("dreport_xchan");
 create index "dreport_queue" on dreport ("dreport_queue");
 create index "dreport_channel" on dreport ("dreport_channel");
 
-
-
-
-
 CREATE TABLE "event" (
   "id" serial NOT NULL,
   "aid" bigint  NOT NULL DEFAULT '0',
   "uid" bigint NOT NULL,
+  "cal_id" bigint NOT NULL DEFAULT '0',
   "event_xchan" text NOT NULL DEFAULT '',
   "event_hash" text NOT NULL DEFAULT '',
   "created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
@@ -415,6 +432,7 @@ CREATE TABLE "event" (
   PRIMARY KEY ("id")
 );
 create index "event_uid_idx" on event ("uid");
+create index "event_cal_idx" on event ("cal_id");
 create index "event_etype_idx" on event ("etype");
 create index "event_dtstart_idx" on event ("dtstart");
 create index "event_dtend_idx" on event ("dtend");
-- 
cgit v1.2.3


From 51e2ef39c221a6f8cd89f8bb9e85a8f374f1fd6c Mon Sep 17 00:00:00 2001
From: redmatrix <git@macgirvin.com>
Date: Thu, 23 Jun 2016 18:35:01 -0700
Subject: db update for abconfig transition

---
 install/schema_postgres.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'install/schema_postgres.sql')

diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 9473252e6..64cf37f7e 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -1,6 +1,6 @@
 CREATE TABLE "abconfig" (
   "id" serial  NOT NULL,
-  "chan" text NOT NULL,
+  "chan" bigint NOT NULL,
   "xchan" text NOT NULL,
   "cat" text NOT NULL,
   "k" text NOT NULL,
-- 
cgit v1.2.3


From f40f7b4d6e291a05ea0a20145bdbe7d98b3d837c Mon Sep 17 00:00:00 2001
From: Habeas Codice <habeascodice@federated.social>
Date: Mon, 27 Jun 2016 06:28:08 -0700
Subject: typos

---
 install/schema_postgres.sql | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'install/schema_postgres.sql')

diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 64cf37f7e..378308233 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -827,15 +827,15 @@ CREATE TABLE "obj" (
   "obj_id" serial  NOT NULL,
   "obj_page" char(64) NOT NULL DEFAULT '',
   "obj_verb" text NOT NULL DEFAULT '',
-  "obj_type" bigint  NOT NULL DEFAULT '0',
+  "obj_type" bigint  NOT NULL DEFAULT 0,
   "obj_obj" text NOT NULL DEFAULT '',
-  "obj_channel" bigint  NOT NULL DEFAULT '0',
+  "obj_channel" bigint  NOT NULL DEFAULT 0,
   "obj_term" char(255) NOT NULL DEFAULT '',
   "obj_url" char(255) NOT NULL DEFAULT '',
   "obj_imgurl" char(255) NOT NULL DEFAULT '',
   "obj_created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
   "obj_edited" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
-  "obj_quantity" int(11) NOT NULL DEFAUL '0'.
+  "obj_quantity" bigint NOT NULL DEFAULT 0,
   "allow_cid" text NOT NULL,
   "allow_gid" text NOT NULL,
   "deny_cid" text NOT NULL,
-- 
cgit v1.2.3


From 6bf2e8a1087546a1986adddcdab486af0891383e Mon Sep 17 00:00:00 2001
From: redmatrix <git@macgirvin.com>
Date: Mon, 4 Jul 2016 16:30:03 -0700
Subject: some perms fixes to stuff that was already written before I move on

---
 install/schema_postgres.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'install/schema_postgres.sql')

diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 378308233..36018de3e 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -888,6 +888,17 @@ CREATE TABLE "pconfig" (
   PRIMARY KEY ("id"),
   UNIQUE ("uid","cat","k")
 );
+create table perm_limits (
+  id serial NOT NULL,
+  perm varchar(64) not null default '',
+  channel_id int(10) unsigned not null default 0,
+  perm_limit int(10) unsigned not null default 0,
+  primary key id 
+);
+create index "idx_perm" on perm_limits ("perm");
+create index "idx_channel_id" on perm_limits ("channel_id");
+create index "idx_perm_limit" on perm_limits ("perm_limit");
+
 CREATE TABLE "photo" (
   "id" serial  NOT NULL,
   "aid" bigint  NOT NULL DEFAULT '0',
-- 
cgit v1.2.3


From e11330a5c8e5111d08d6aee1f4dc6dda6f7c7f2a Mon Sep 17 00:00:00 2001
From: redmatrix <git@macgirvin.com>
Date: Thu, 7 Jul 2016 16:44:58 -0700
Subject: revise how we store perm_limits

---
 install/schema_postgres.sql | 10 ----------
 1 file changed, 10 deletions(-)

(limited to 'install/schema_postgres.sql')

diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 36018de3e..a86102b53 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -888,16 +888,6 @@ CREATE TABLE "pconfig" (
   PRIMARY KEY ("id"),
   UNIQUE ("uid","cat","k")
 );
-create table perm_limits (
-  id serial NOT NULL,
-  perm varchar(64) not null default '',
-  channel_id int(10) unsigned not null default 0,
-  perm_limit int(10) unsigned not null default 0,
-  primary key id 
-);
-create index "idx_perm" on perm_limits ("perm");
-create index "idx_channel_id" on perm_limits ("channel_id");
-create index "idx_perm_limit" on perm_limits ("perm_limit");
 
 CREATE TABLE "photo" (
   "id" serial  NOT NULL,
-- 
cgit v1.2.3


From b6987b4287bb2492b8f4000bdef08b376aa5f265 Mon Sep 17 00:00:00 2001
From: redmatrix <git@macgirvin.com>
Date: Tue, 12 Jul 2016 13:15:20 -0700
Subject: the abconfig defaults weren't changed in the schema files when they
 were changed in the code

---
 install/schema_postgres.sql | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'install/schema_postgres.sql')

diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 378308233..5080d7608 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -1,6 +1,6 @@
 CREATE TABLE "abconfig" (
   "id" serial  NOT NULL,
-  "chan" bigint NOT NULL,
+  "chan" bigint NOT NULL DEFAULT '0',
   "xchan" text NOT NULL,
   "cat" text NOT NULL,
   "k" text NOT NULL,
-- 
cgit v1.2.3


From 94bd53c0f1faa333991786684028e347ab17cfb9 Mon Sep 17 00:00:00 2001
From: redmatrix <git@macgirvin.com>
Date: Thu, 14 Jul 2016 20:51:15 -0700
Subject: schema updates for zot access tokens

---
 install/schema_postgres.sql | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'install/schema_postgres.sql')

diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 5080d7608..1a770d4ff 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -137,6 +137,21 @@ create index "app_created" on app ("app_created");
 create index "app_edited" on app ("app_edited");
 create index "app_deleted" on app ("app_deleted");
 create index "app_system" on app ("app_system");
+
+CREATE TABLE "atoken" (
+  "atoken_id" serial NOT NULL,
+  "atoken_aid" bigint NOT NULL DEFAULT 0,
+  "atoken_uid" bigint NOT NULL DEFAULT 0,
+  "atoken_name" varchar(255) NOT NULL DEFAULT '',
+  "atoken_token" varchar(255) NOT NULL DEFAULT '',
+  "atoken_expires" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+  PRIMARY KEY ("atoken_id"));
+create index atoken_aid on atoken (atoken_aid);
+create index atoken_uid on atoken (atoken_uid);
+create index atoken_name on atoken (atoken_name);
+create index atoken_token on atoken (atoken_token);
+create index atoken_expires on atoken (atoken_expires);
+
 CREATE TABLE "attach" (
   "id" serial  NOT NULL,
   "aid" bigint  NOT NULL DEFAULT '0',
-- 
cgit v1.2.3


From bc74425872704ad955b37de18639ec831a245761 Mon Sep 17 00:00:00 2001
From: redmatrix <git@macgirvin.com>
Date: Thu, 28 Jul 2016 16:02:51 -0700
Subject: Revert "Merge branch '1.10RC' of
 https://github.com/redmatrix/hubzilla into 1.10RC_merge"

This reverts commit 35f17acb388f68745068d6a60e12c7b777b92282, reversing
changes made to 58cf5f310d89026fb526e201c301075725044e48.
---
 install/schema_postgres.sql | 1 -
 1 file changed, 1 deletion(-)

(limited to 'install/schema_postgres.sql')

diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 44711c190..1a770d4ff 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -903,7 +903,6 @@ CREATE TABLE "pconfig" (
   PRIMARY KEY ("id"),
   UNIQUE ("uid","cat","k")
 );
-
 CREATE TABLE "photo" (
   "id" serial  NOT NULL,
   "aid" bigint  NOT NULL DEFAULT '0',
-- 
cgit v1.2.3

