diff plugins/calendar/drivers/database/SQL/sqlite/2013071800.sql @ 3:f6fe4b6ae66a

calendar plugin nearly as distributed
author Charlie Root
date Sat, 13 Jan 2018 08:56:12 -0500
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/plugins/calendar/drivers/database/SQL/sqlite/2013071800.sql	Sat Jan 13 08:56:12 2018 -0500
@@ -0,0 +1,64 @@
+-- SQLite database updates since version 0.9.1
+
+-- ALTER TABLE events ADD custom text DEFAULT NULL AFTER attendees;
+
+CREATE TABLE temp_events (
+  event_id integer NOT NULL PRIMARY KEY,
+  calendar_id integer NOT NULL default '0',
+  recurrence_id integer NOT NULL default '0',
+  uid varchar(255) NOT NULL default '',
+  created datetime NOT NULL default '1000-01-01 00:00:00',
+  changed datetime NOT NULL default '1000-01-01 00:00:00',
+  sequence integer NOT NULL default '0',
+  start datetime NOT NULL default '1000-01-01 00:00:00',
+  end datetime NOT NULL default '1000-01-01 00:00:00',
+  recurrence varchar(255) default NULL,
+  title varchar(255) NOT NULL,
+  description text NOT NULL,
+  location varchar(255) NOT NULL default '',
+  categories varchar(255) NOT NULL default '',
+  all_day tinyint(1) NOT NULL default '0',
+  free_busy tinyint(1) NOT NULL default '0',
+  priority tinyint(1) NOT NULL default '0',
+  sensitivity tinyint(1) NOT NULL default '0',
+  alarms varchar(255) default NULL,
+  attendees text default NULL,
+  notifyat datetime default NULL
+);
+
+INSERT INTO temp_events (event_id, calendar_id, recurrence_id, uid, created, changed, sequence, start, end, recurrence, title, description, location, categories, all_day, free_busy, priority, sensitivity, alarms, attendees, notifyat)
+    SELECT event_id, calendar_id, recurrence_id, uid, created, changed, sequence, start, end, recurrence, title, description, location, categories, all_day, free_busy, priority, sensitivity, alarms, attendees, notifyat FROM events;
+
+DROP TABLE events;
+
+CREATE TABLE events (
+  event_id integer NOT NULL PRIMARY KEY,
+  calendar_id integer NOT NULL default '0',
+  recurrence_id integer NOT NULL default '0',
+  uid varchar(255) NOT NULL default '',
+  created datetime NOT NULL default '1000-01-01 00:00:00',
+  changed datetime NOT NULL default '1000-01-01 00:00:00',
+  sequence integer NOT NULL default '0',
+  start datetime NOT NULL default '1000-01-01 00:00:00',
+  end datetime NOT NULL default '1000-01-01 00:00:00',
+  recurrence varchar(255) default NULL,
+  title varchar(255) NOT NULL,
+  description text NOT NULL,
+  location varchar(255) NOT NULL default '',
+  categories varchar(255) NOT NULL default '',
+  url varchar(255) NOT NULL default '',
+  all_day tinyint(1) NOT NULL default '0',
+  free_busy tinyint(1) NOT NULL default '0',
+  priority tinyint(1) NOT NULL default '0',
+  sensitivity tinyint(1) NOT NULL default '0',
+  alarms varchar(255) default NULL,
+  attendees text default NULL,
+  custom text default NULL,
+  notifyat datetime default NULL,
+  CONSTRAINT fk_events_calendar_id FOREIGN KEY (calendar_id)
+    REFERENCES calendars(calendar_id)
+);
+
+INSERT INTO events (event_id, calendar_id, recurrence_id, uid, created, changed, sequence, start, end, recurrence, title, description, location, categories, all_day, free_busy, priority, sensitivity, alarms, attendees, notifyat)
+    SELECT event_id, calendar_id, recurrence_id, uid, created, changed, sequence, start, end, recurrence, title, description, location, categories, all_day, free_busy, priority, sensitivity, alarms, attendees, notifyat FROM temp_events;
+