diff --git a/civicrm/ext/standaloneusers/sql/auto_install.sql b/civicrm/ext/standaloneusers/sql/auto_install.sql new file mode 100644 index 0000000000000000000000000000000000000000..6bec096b99db0b8b31f2b3991f99610432fc8d2a --- /dev/null +++ b/civicrm/ext/standaloneusers/sql/auto_install.sql @@ -0,0 +1,71 @@ +-- +--------------------------------------------------------------------+ +-- | Copyright CiviCRM LLC. All rights reserved. | +-- | | +-- | This work is published under the GNU AGPLv3 license with some | +-- | permitted exceptions and without any warranty. For full license | +-- | and copyright information, see https://civicrm.org/licensing | +-- +--------------------------------------------------------------------+ +-- +-- Generated from schema.tpl +-- DO NOT EDIT. Generated by CRM_Core_CodeGen +-- +-- /******************************************************* +-- * +-- * Clean up the existing tables - this section generated from drop.tpl +-- * +-- *******************************************************/ + +SET FOREIGN_KEY_CHECKS=0; + +DROP TABLE IF EXISTS `civicrm_user`; +DROP TABLE IF EXISTS `civicrm_role`; + +SET FOREIGN_KEY_CHECKS=1; +-- /******************************************************* +-- * +-- * Create new tables +-- * +-- *******************************************************/ + +-- /******************************************************* +-- * +-- * civicrm_role +-- * +-- * A Role holds a set of permissions. Roles may be granted to Users. +-- * +-- *******************************************************/ +CREATE TABLE `civicrm_role` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique Role ID', + `name` varchar(60) NOT NULL COMMENT 'Machine name for this role', + `label` varchar(128) NOT NULL COMMENT 'Human friendly name for this role', + `permissions` text NOT NULL COMMENT 'List of permissions granted by this role', + `is_active` tinyint DEFAULT 1 COMMENT 'Only active roles grant permissions', + PRIMARY KEY (`id`) +) +ENGINE=InnoDB; + +-- /******************************************************* +-- * +-- * civicrm_user +-- * +-- * A standalone user account +-- * +-- *******************************************************/ +CREATE TABLE `civicrm_user` ( + `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Unique User ID', + `contact_id` int unsigned COMMENT 'FK to Contact - possibly redundant', + `username` varchar(60) NOT NULL, + `password` varchar(128) NOT NULL COMMENT 'Hashed password', + `email` varchar(255) NOT NULL COMMENT 'Email (e.g. for password resets)', + `roles` varchar(128) COMMENT 'FK to Role', + `when_created` timestamp DEFAULT CURRENT_TIMESTAMP, + `when_last_accessed` timestamp NULL, + `when_updated` timestamp NULL, + `is_active` tinyint NOT NULL DEFAULT 1, + `timezone` varchar(32) NULL COMMENT 'User\'s timezone', + `language` int unsigned COMMENT 'The language for the user.', + PRIMARY KEY (`id`), + UNIQUE INDEX `UI_username`(username), + CONSTRAINT FK_civicrm_user_contact_id FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact`(`id`) ON DELETE CASCADE +) +ENGINE=InnoDB; diff --git a/civicrm/ext/standaloneusers/sql/auto_uninstall.sql b/civicrm/ext/standaloneusers/sql/auto_uninstall.sql new file mode 100644 index 0000000000000000000000000000000000000000..f754abde63ab098603b029ffb399afb24e12249b --- /dev/null +++ b/civicrm/ext/standaloneusers/sql/auto_uninstall.sql @@ -0,0 +1,21 @@ +-- +--------------------------------------------------------------------+ +-- | Copyright CiviCRM LLC. All rights reserved. | +-- | | +-- | This work is published under the GNU AGPLv3 license with some | +-- | permitted exceptions and without any warranty. For full license | +-- | and copyright information, see https://civicrm.org/licensing | +-- +--------------------------------------------------------------------+ +-- +-- Generated from drop.tpl +-- DO NOT EDIT. Generated by CRM_Core_CodeGen +---- /******************************************************* +-- * +-- * Clean up the existing tables-- * +-- *******************************************************/ + +SET FOREIGN_KEY_CHECKS=0; + +DROP TABLE IF EXISTS `civicrm_user`; +DROP TABLE IF EXISTS `civicrm_role`; + +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file