text: -- phpMyAdmin SQL Dump
  -- version 4.0.10deb1ubuntu0.1
  -- http://www.phpmyadmin.net
  --
  -- Host: localhost
  -- Generation Time: Dec 18, 2019 at 06:08 AM
  -- Server version: 5.6.33-0ubuntu0.14.04.1
  -- PHP Version: 7.1.20-1+ubuntu14.04.1+deb.sury.org+1
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET time_zone = "+00:00";
  
  --
  -- Database: `dallas`
  --
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `apps`
  --
  
  CREATE TABLE IF NOT EXISTS `apps` (
    `appId` int(20) NOT NULL AUTO_INCREMENT,
    `appName` varchar(250) DEFAULT NULL,
    `appPath` varchar(255) DEFAULT NULL,
    `appStatus` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Active,2=Inactive',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`appId`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
  
  --
  -- Dumping data for table `apps`
  --
  
  INSERT INTO `apps` (`appId`, `appName`, `appPath`, `appStatus`, `createdBy`, `created_at`, `updatedBy`, `updated_at`, `deletedBy`, `deleted_at`) VALUES
  (1, 'accounts', 'accounts', 1, NULL, '2019-07-15 21:02:37', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (2, 'check-ins', 'checkins', 1, NULL, '2019-07-15 21:02:37', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (3, 'giving', 'giving', 1, NULL, '2019-07-15 21:02:37', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (4, 'groups', 'groups', 1, NULL, '2019-07-15 21:02:37', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (5, 'people', 'people', 1, NULL, '2019-07-15 21:02:37', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (6, 'registrations', 'registrations', 1, NULL, '2019-07-15 21:02:37', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (7, 'resources', 'resources', 1, NULL, '2019-07-15 21:02:37', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (8, 'services', 'services', 1, NULL, '2019-07-15 21:02:37', NULL, '0000-00-00 00:00:00', NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `checkins`
  --
  
  CREATE TABLE IF NOT EXISTS `checkins` (
    `chId` bigint(20) NOT NULL AUTO_INCREMENT,
    `eventId` bigint(20) NOT NULL,
    `user_id` bigint(20) DEFAULT NULL,
    `chINDateTime` timestamp NULL DEFAULT NULL,
    `chOUTDateTime` timestamp NULL DEFAULT NULL,
    `chKind` enum('Regular','Guest','Volunteer') DEFAULT 'Regular' COMMENT 'user type with ''Regular'',''Guest'',''Volunteer''',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`chId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `comm_details`
  --
  
  CREATE TABLE IF NOT EXISTS `comm_details` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `comm_master_id` bigint(20) NOT NULL,
    `to_user_id` bigint(20) NOT NULL,
    `read_status` varchar(255) NOT NULL DEFAULT 'UNREAD' COMMENT 'Read status:READ,UNREAD',
    `delete_status` varchar(255) NOT NULL DEFAULT 'UNDELETED' COMMENT 'Message status:DELETED,UNDELETED',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `comm_masters`
  --
  
  CREATE TABLE IF NOT EXISTS `comm_masters` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `comm_template_id` bigint(20) DEFAULT NULL,
    `org_id` bigint(20) NOT NULL,
    `type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Email,2=Notification',
    `tag` varchar(255) CHARACTER SET latin1 DEFAULT NULL,
    `name` text,
    `subject` varchar(255) DEFAULT NULL,
    `body` text,
    `from_user_id` bigint(20) DEFAULT NULL COMMENT 'From UserId',
    `related_id` bigint(22) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `comm_templates`
  --
  
  CREATE TABLE IF NOT EXISTS `comm_templates` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `tag` varchar(255) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `subject` text,
    `body` text,
    `org_id` bigint(20) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
  
  --
  -- Dumping data for table `comm_templates`
  --
  
  INSERT INTO `comm_templates` (`id`, `tag`, `name`, `subject`, `body`, `org_id`, `createdBy`, `created_at`, `updatedBy`, `updated_at`, `deletedBy`, `deleted_at`) VALUES
  (1, 'welcome', 'Welcome Email', 'Welcome Email Sujbect', 'Welcome Email Body', 0, NULL, '2019-08-21 18:01:18', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (2, 'household_added', 'household_added name', 'household_added subj', 'household_added body', 0, NULL, '2019-08-21 18:01:18', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (3, 'event_added', 'event_added name', 'event_added sub ', 'event_added body', 0, NULL, '2019-08-21 18:01:35', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (4, 'schedule_auto_notify', 'Auto Scheduling Notification', 'Event scheduled', 'Your have been placed on the schedule. (Auto assigned)', 0, NULL, '2019-09-27 14:34:53', NULL, NULL, NULL, NULL),
  (5, 'schedule_manual_notify', 'Scheduling event', 'Event Scheduled', 'Your Event has been scheduled, please follow the below mentioned details.', 0, NULL, '2019-09-27 14:34:53', NULL, NULL, NULL, NULL),
  (6, 'schedule_confirmation', 'Schedule confirmation', 'Schedule Confirmation', 'You have been placed on the schedule for the following dates. To respond or simply view this schedule, click the appropriate button below.', 0, NULL, '2019-09-27 14:34:53', NULL, NULL, NULL, NULL),
  (7, 'schedule_reminder', 'Schedule Remind', 'Schedule Remind', 'A Reminder that your event has been scheduled for below listed dates.', 0, NULL, '2019-09-27 14:34:53', NULL, NULL, NULL, NULL),
  (8, 'schedule_check_out_notification_to_guest', 'Schedule check out notification to guest', 'Event Schedule Notification', 'This is notify that event has been scheduled.thank_you_for_service', 0, NULL, '2019-09-27 14:34:53', NULL, NULL, NULL, NULL),
  (9, 'thank_you_for_service', 'Thanks for your service', 'Thanks for Service', 'Thanks for attending the below listed event.', 0, NULL, '2019-09-27 14:34:53', NULL, NULL, NULL, NULL),
  (10, 'schedule_cancelled', 'Schedule cancelled', 'Schedule cancelled', 'sorry to inform you that. Your scheduled event has been canceled. For further information contact administrator.', 0, NULL, '2019-09-27 14:34:53', NULL, NULL, NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `events`
  --
  
  CREATE TABLE IF NOT EXISTS `events` (
    `eventId` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) DEFAULT NULL,
    `eventName` varchar(250) DEFAULT NULL,
    `eventFreq` varchar(250) DEFAULT NULL COMMENT 'Daily,Weekly,None',
    `eventDesc` text,
    `eventCreatedDate` date DEFAULT NULL,
    `eventCheckin` time DEFAULT NULL,
    `eventShowTime` time DEFAULT NULL,
    `eventStartCheckin` time DEFAULT NULL,
    `eventEndCheckin` time DEFAULT NULL,
    `eventLocation` text,
    `eventRoom` int(11) DEFAULT NULL,
    `eventResource` int(11) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`eventId`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `forms`
  --
  
  CREATE TABLE IF NOT EXISTS `forms` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) DEFAULT NULL,
    `title` varchar(250) DEFAULT NULL,
    `description` varchar(250) DEFAULT NULL,
    `fields` varchar(1000) DEFAULT NULL,
    `profile_fields` varchar(250) DEFAULT NULL,
    `general_fields` varchar(500) DEFAULT NULL,
    `is_active` int(11) NOT NULL DEFAULT '1' COMMENT '1 - active, 2 - deactive',
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `form_submissions`
  --
  
  CREATE TABLE IF NOT EXISTS `form_submissions` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) DEFAULT NULL,
    `form_id` bigint(20) DEFAULT NULL,
    `profile_fields` varchar(1000) DEFAULT NULL,
    `general_fields` varchar(1000) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `giving`
  --
  
  CREATE TABLE IF NOT EXISTS `giving` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `user_id` bigint(20) DEFAULT NULL,
    `orgId` bigint(20) DEFAULT NULL,
    `event_id` bigint(20) DEFAULT NULL,
    `email` varchar(255) DEFAULT NULL,
    `first_name` varchar(255) DEFAULT NULL,
    `middle_name` varchar(255) DEFAULT NULL,
    `last_name` varchar(255) DEFAULT NULL,
    `full_name` varchar(255) DEFAULT NULL,
    `mobile_no` varchar(20) DEFAULT NULL,
    `payment_mode_id` bigint(20) DEFAULT NULL,
    `sub_payment_mode_id` bigint(20) DEFAULT NULL,
    `amount` varchar(25) DEFAULT NULL,
    `pay_mode` varchar(100) DEFAULT NULL COMMENT 'Credit,Debit',
    `purpose_note` text,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `groups`
  --
  
  CREATE TABLE IF NOT EXISTS `groups` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) NOT NULL,
    `groupType_id` bigint(20) NOT NULL,
    `name` varchar(100) NOT NULL,
    `description` text,
    `notes` text,
    `image_path` text,
    `meeting_schedule` text,
    `isPublic` tinyint(1) DEFAULT '1' COMMENT '0=Disable, 1=Enable',
    `location` varchar(255) DEFAULT NULL,
    `is_enroll_autoClose` tinyint(1) NOT NULL DEFAULT '0',
    `enroll_autoClose_on` date DEFAULT NULL,
    `is_enroll_autoClose_count` tinyint(1) NOT NULL DEFAULT '0',
    `enroll_autoClose_count` int(15) DEFAULT NULL COMMENT 'Max attendendies per group',
    `is_enroll_notify_count` tinyint(1) NOT NULL DEFAULT '0',
    `enroll_notify_count` int(15) DEFAULT NULL,
    `contact_email` varchar(75) DEFAULT NULL,
    `visible_leaders_fields` text COMMENT 'Stored in serialized formate',
    `visible_members_fields` text COMMENT 'Stored in serialized Formate',
    `can_leaders_search_people` tinyint(1) NOT NULL DEFAULT '1',
    `can_leaders_take_attendance` tinyint(1) NOT NULL DEFAULT '1',
    `is_event_remind` tinyint(1) NOT NULL DEFAULT '1',
    `event_remind_before` int(5) DEFAULT '0',
    `enroll_status` tinyint(1) NOT NULL DEFAULT '1',
    `enroll_msg` varchar(255) DEFAULT NULL,
    `leader_visibility_publicly` tinyint(1) NOT NULL DEFAULT '1',
    `is_event_public` tinyint(1) NOT NULL DEFAULT '1',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `group_enrolls`
  --
  
  CREATE TABLE IF NOT EXISTS `group_enrolls` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `group_id` bigint(22) DEFAULT NULL,
    `email` varchar(100) DEFAULT NULL,
    `first_name` varchar(100) DEFAULT NULL,
    `middle_name` varchar(100) DEFAULT NULL,
    `last_name` varchar(100) DEFAULT NULL,
    `full_name` varchar(255) DEFAULT NULL,
    `mobile_no` int(15) DEFAULT NULL,
    `message` text,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `group_events`
  --
  
  CREATE TABLE IF NOT EXISTS `group_events` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `group_id` bigint(22) DEFAULT NULL,
    `title` varchar(150) NOT NULL,
    `isMutiDay_event` tinyint(1) NOT NULL DEFAULT '1',
    `start_date` date DEFAULT NULL,
    `end_date` date DEFAULT NULL,
    `start_time` time DEFAULT NULL,
    `end_time` time DEFAULT NULL,
    `repeat` varchar(255) DEFAULT NULL,
    `location` varchar(255) DEFAULT NULL,
    `description` text,
    `is_event_remind` tinyint(1) NOT NULL DEFAULT '1',
    `event_remind_before` varchar(255) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `group_events_attendance`
  --
  
  CREATE TABLE IF NOT EXISTS `group_events_attendance` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `event_id` bigint(22) DEFAULT NULL,
    `group_member_id` bigint(22) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `group_members`
  --
  
  CREATE TABLE IF NOT EXISTS `group_members` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) NOT NULL,
    `group_id` bigint(22) DEFAULT NULL,
    `isUser` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=User, 2=Enrolled User',
    `user_id` bigint(20) DEFAULT NULL,
    `role` tinyint(1) NOT NULL DEFAULT '2' COMMENT '1=Leader, 2=Member',
    `email` varchar(100) DEFAULT NULL,
    `first_name` varchar(100) DEFAULT NULL,
    `middle_name` varchar(100) DEFAULT NULL,
    `last_name` varchar(100) DEFAULT NULL,
    `full_name` varchar(255) DEFAULT NULL,
    `mobile_no` varchar(15) DEFAULT NULL,
    `message` text,
    `member_since` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `group_resources`
  --
  
  CREATE TABLE IF NOT EXISTS `group_resources` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `group_id` bigint(22) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=File, 2=URL Path',
    `source` text,
    `description` text,
    `visibility` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Only for Leaders / Admins, 2=ALL',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `group_tags`
  --
  
  CREATE TABLE IF NOT EXISTS `group_tags` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `group_id` bigint(22) DEFAULT NULL,
    `tag_id` bigint(22) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `group_types`
  --
  
  CREATE TABLE IF NOT EXISTS `group_types` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) NOT NULL,
    `name` varchar(100) NOT NULL,
    `description` text,
    `isPublic` tinyint(1) NOT NULL DEFAULT '1',
    `d_isPublic` tinyint(1) DEFAULT '1' COMMENT '0=Disable, 1=Enable',
    `d_meeting_schedule` text,
    `d_description` text,
    `d_location` varchar(255) DEFAULT NULL,
    `d_contact_email` varchar(75) DEFAULT NULL,
    `d_visible_leaders_fields` text COMMENT 'Stored in serialized formate',
    `d_visible_members_fields` text COMMENT 'Stored in serialized Formate',
    `d_is_enroll_autoClose` tinyint(1) NOT NULL DEFAULT '0',
    `d_enroll_autoClose_on` date DEFAULT NULL,
    `d_is_enroll_autoClose_count` tinyint(1) NOT NULL DEFAULT '0',
    `d_enroll_autoClose_count` int(15) DEFAULT NULL COMMENT 'Max attendendies per group',
    `d_is_enroll_notify_count` tinyint(1) NOT NULL DEFAULT '0',
    `d_enroll_notify_count` int(15) DEFAULT NULL,
    `d_can_leaders_search_people` tinyint(1) NOT NULL DEFAULT '1',
    `d_is_event_public` tinyint(1) NOT NULL DEFAULT '1',
    `d_is_event_remind` tinyint(1) NOT NULL DEFAULT '1',
    `d_event_remind_before` int(5) DEFAULT NULL,
    `d_can_leaders_take_attendance` tinyint(1) NOT NULL DEFAULT '1',
    `d_enroll_status` tinyint(1) NOT NULL DEFAULT '1',
    `d_enroll_msg` varchar(255) DEFAULT NULL,
    `d_leader_visibility_publicly` tinyint(1) NOT NULL DEFAULT '1',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `households`
  --
  
  CREATE TABLE IF NOT EXISTS `households` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) NOT NULL,
    `hhPrimaryUserId` bigint(20) NOT NULL,
    `name` varchar(250) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
   
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `household_user`
  --
  
  CREATE TABLE IF NOT EXISTS `household_user` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `household_id` bigint(20) NOT NULL,
    `user_id` bigint(20) NOT NULL,
    `isPrimary` tinyint(2) NOT NULL DEFAULT '2',
    `createdBy` bigint(20) DEFAULT NULL,
    `updatedBy` text,
    `deletedBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `locations`
  --
  
  CREATE TABLE IF NOT EXISTS `locations` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(22) DEFAULT NULL,
    `name` varchar(250) NOT NULL,
    `latitude` varchar(100) NOT NULL,
    `longitude` varchar(100) NOT NULL,
    `createdBy` int(11) DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` int(11) DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` int(11) DEFAULT NULL,
    `deleted_at` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `master_lookup_data`
  --
  
  CREATE TABLE IF NOT EXISTS `master_lookup_data` (
    `mldId` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) DEFAULT NULL,
    `mldKey` varchar(150) DEFAULT NULL,
    `mldValue` varchar(200) DEFAULT NULL,
    `mldType` enum('A','B') NOT NULL DEFAULT 'A' COMMENT ' A=Master Code,B=Organization Added Code',
    `mldOption` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Edit - Delete, 2=Edit - No Delete,3=No Edit - Delete,4=No Edit - No Delete',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`mldId`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=34 ;
  
  --
  -- Dumping data for table `master_lookup_data`
  --
  
  INSERT INTO `master_lookup_data` (`mldId`, `orgId`, `mldKey`, `mldValue`, `mldType`, `mldOption`, `createdBy`, `created_at`, `updatedBy`, `updated_at`, `deletedBy`, `deleted_at`) VALUES
  (1, 0, 'school_name', 'High School', 'A', 1, NULL, '2019-07-10 12:21:10', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (2, 0, 'school_name', 'Middle School', 'A', 1, NULL, '2019-07-10 12:30:06', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (3, 0, 'name_prefix', 'Mr.', 'A', 1, NULL, '2019-07-10 12:30:07', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (4, 0, 'name_prefix', 'Mrs.', 'A', 1, NULL, '2019-07-10 12:30:07', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (5, 0, 'name_prefix', 'Ms.', 'A', 1, NULL, '2019-07-10 12:30:07', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (6, 0, 'name_prefix', 'Miss', 'A', 1, NULL, '2019-07-10 12:30:07', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (7, 0, 'name_prefix', 'Dr.', 'A', 1, NULL, '2019-07-10 12:30:07', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (8, 0, 'name_prefix', 'Rev.', 'A', 1, NULL, '2019-07-10 12:30:07', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (9, 0, 'name_suffix', 'Jr.', 'A', 1, NULL, '2019-07-10 12:30:07', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (10, 0, 'name_suffix', 'Sr.', 'A', 1, NULL, '2019-07-10 12:30:07', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (11, 0, 'name_suffix', 'Ph.D.', 'A', 1, NULL, '2019-07-10 12:30:08', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (12, 0, 'name_suffix', 'II', 'A', 1, NULL, '2019-07-10 12:30:08', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (13, 0, 'name_suffix', 'III', 'A', 1, NULL, '2019-07-10 12:30:08', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (14, 0, 'membership_inactive_reason', 'Moved', 'A', 1, NULL, '2019-07-10 12:30:08', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (15, 0, 'membership_inactive_reason', 'New Church', 'A', 1, NULL, '2019-07-10 12:30:08', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (16, 0, 'membership_inactive_reason', 'Deceased', 'A', 4, NULL, '2019-07-10 12:30:08', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (17, 0, 'marital_status', 'Single', 'A', 1, NULL, '2019-07-10 12:30:09', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (18, 0, 'marital_status', 'Married', 'A', 4, NULL, '2019-07-10 12:30:09', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (19, 0, 'marital_status', 'Widowed', 'A', 1, NULL, '2019-07-10 12:30:09', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (20, 0, 'membership_status', 'Member', 'A', 1, NULL, '2019-07-10 12:30:09', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (21, 0, 'membership_status', 'Regular Attender', 'A', 1, NULL, '2019-07-10 12:30:09', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (22, 0, 'membership_status', 'Visitor', 'A', 1, NULL, '2019-07-10 12:30:09', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (23, 0, 'membership_status', 'Participant', 'A', 1, NULL, '2019-07-10 12:30:09', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (24, 0, 'membership_status', 'In Progress', 'A', 1, NULL, '2019-07-10 12:30:09', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (25, 0, 'grade_name', 'Pre-K', 'A', 4, NULL, '2019-07-10 13:13:30', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (26, 0, 'grade_name', 'K', 'A', 4, NULL, '2019-07-10 13:13:30', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (27, 0, 'grade_name', '1st', 'A', 4, NULL, '2019-07-10 13:13:30', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (28, 0, 'grade_name', '2nd', 'A', 1, NULL, '2019-07-10 13:13:30', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (29, 0, 'grade_name', '3rd', 'A', 4, NULL, '2019-07-10 13:13:30', NULL, '2019-07-16 12:09:52', NULL, NULL),
  (30, 0, 'room_group', 'Group1', 'A', 4, NULL, '2019-08-22 16:33:55', NULL, '2019-08-22 16:33:55', NULL, NULL),
  (31, 0, 'resource_category', 'Electronic', 'A', 4, NULL, '2019-08-22 16:33:55', NULL, '2019-08-22 16:33:55', NULL, NULL),
  (32, 0, 'pastor_board', 'Electronic', 'A', 1, NULL, '2019-09-11 09:35:01', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (33, 0, 'pastor_board', 'Home Care', 'A', 1, NULL, '2019-09-11 09:35:01', NULL, '0000-00-00 00:00:00', NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `migrations`
  --
  
  CREATE TABLE IF NOT EXISTS `migrations` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `batch` int(11) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=14 ;
  
  --
  -- Dumping data for table `migrations`
  --
  
  INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
  (5, '2014_10_12_000000_create_users_table', 1),
  (6, '2014_10_12_100000_create_password_resets_table', 1),
  (7, '2019_05_06_061007_create_permission_tables', 1),
  (8, '2019_05_06_061659_create_posts_table', 1),
  (9, '2016_06_01_000001_create_oauth_auth_codes_table', 2),
  (10, '2016_06_01_000002_create_oauth_access_tokens_table', 2),
  (11, '2016_06_01_000003_create_oauth_refresh_tokens_table', 2),
  (12, '2016_06_01_000004_create_oauth_clients_table', 2),
  (13, '2016_06_01_000005_create_oauth_personal_access_clients_table', 2);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `model_has_permissions`
  --
  
  CREATE TABLE IF NOT EXISTS `model_has_permissions` (
    `permission_id` int(10) unsigned NOT NULL,
    `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `model_id` bigint(20) unsigned NOT NULL,
    PRIMARY KEY (`permission_id`,`model_id`,`model_type`),
    KEY `model_has_permissions_model_id_model_type_index` (`model_id`,`model_type`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `model_has_roles`
  --
  
  CREATE TABLE IF NOT EXISTS `model_has_roles` (
    `role_id` int(10) unsigned NOT NULL,
    `model_type` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `model_id` bigint(20) unsigned NOT NULL,
    PRIMARY KEY (`role_id`,`model_id`,`model_type`),
    KEY `model_has_roles_model_id_model_type_index` (`model_id`,`model_type`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `oauth_access_tokens`
  --
  
  CREATE TABLE IF NOT EXISTS `oauth_access_tokens` (
    `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `user_id` int(11) DEFAULT NULL,
    `client_id` int(10) unsigned NOT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `scopes` text COLLATE utf8mb4_unicode_ci,
    `revoked` tinyint(1) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `expires_at` datetime DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `oauth_access_tokens_user_id_index` (`user_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `oauth_auth_codes`
  --
  
  CREATE TABLE IF NOT EXISTS `oauth_auth_codes` (
    `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `user_id` int(11) NOT NULL,
    `client_id` int(10) unsigned NOT NULL,
    `scopes` text COLLATE utf8mb4_unicode_ci,
    `revoked` tinyint(1) NOT NULL,
    `expires_at` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `oauth_clients`
  --
  
  CREATE TABLE IF NOT EXISTS `oauth_clients` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `user_id` int(11) DEFAULT NULL,
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `secret` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `redirect` text COLLATE utf8mb4_unicode_ci NOT NULL,
    `personal_access_client` tinyint(1) NOT NULL,
    `password_client` tinyint(1) NOT NULL,
    `revoked` tinyint(1) NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `oauth_clients_user_id_index` (`user_id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=3 ;
  
  --
  -- Dumping data for table `oauth_clients`
  --
  
  INSERT INTO `oauth_clients` (`id`, `user_id`, `name`, `secret`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `created_at`, `updated_at`) VALUES
  (1, NULL, 'Laravel Personal Access Client', 'KTpGS8SGl59m7hYg24lfah08jwIvdGi4xmdwCRJl', 'http://localhost', 1, 0, 0, '2019-04-22 11:22:39', '2019-04-22 11:22:39'),
  (2, NULL, 'Laravel Password Grant Client', '9beWRls9Vc1uMuBkuN0PT1ypowdrXmxnf27GVqha', 'http://localhost', 0, 1, 0, '2019-04-22 11:22:39', '2019-04-22 11:22:39');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `oauth_personal_access_clients`
  --
  
  CREATE TABLE IF NOT EXISTS `oauth_personal_access_clients` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `client_id` int(10) unsigned NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `oauth_personal_access_clients_client_id_index` (`client_id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=2 ;
  
  --
  -- Dumping data for table `oauth_personal_access_clients`
  --
  
  INSERT INTO `oauth_personal_access_clients` (`id`, `client_id`, `created_at`, `updated_at`) VALUES
  (1, 1, '2019-05-05 20:28:45', '2019-05-05 20:28:45');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `oauth_refresh_tokens`
  --
  
  CREATE TABLE IF NOT EXISTS `oauth_refresh_tokens` (
    `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
    `revoked` tinyint(1) NOT NULL,
    `expires_at` datetime DEFAULT NULL,
    PRIMARY KEY (`id`),
    KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `organization`
  --
  
  CREATE TABLE IF NOT EXISTS `organization` (
    `orgId` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgName` varchar(255) NOT NULL,
    `orgAddress` text,
    `orgAptUnitBox` text,
    `orgCity` varchar(255) DEFAULT NULL,
    `orgState` varchar(255) DEFAULT NULL,
    `orgPincode` varchar(100) DEFAULT NULL,
    `orgPhone` varchar(50) DEFAULT NULL,
    `orgLogo` text,
    `orgTimeZone` text,
    `orgTimeCountry` int(20) DEFAULT NULL,
    `orgTimeFormat` varchar(10) DEFAULT NULL,
    `orgDateFormat` varchar(255) DEFAULT NULL,
    `orgCurrency` varchar(150) DEFAULT NULL,
    `orgEmail` text,
    `orgWebsite` text,
    `orgTaxIdNo` varchar(150) DEFAULT NULL,
    `orgDomain` varchar(250) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`orgId`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
   
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `other_payment_methods`
  --
  
  CREATE TABLE IF NOT EXISTS `other_payment_methods` (
    `other_payment_method_id` int(11) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) DEFAULT NULL,
    `payment_method` varchar(100) NOT NULL,
    `payment_method_notes` text,
    `confirm_payment_method` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0=Deactive,1=Active  (When a student submits the registration fee method with flag 1 , the payment status will be marked as confirmed )',
    `status` int(1) NOT NULL DEFAULT '1' COMMENT '0=Inactive,1=Active',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`other_payment_method_id`),
    KEY `orgId` (`orgId`) USING BTREE
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
  
  --
  -- Dumping data for table `other_payment_methods`
  --
  
  INSERT INTO `other_payment_methods` (`other_payment_method_id`, `orgId`, `payment_method`, `payment_method_notes`, `confirm_payment_method`, `status`, `createdBy`, `created_at`, `updatedBy`, `updated_at`, `deletedBy`, `deleted_at`) VALUES
  (1, NULL, 'Cash', 'other_payment_methods', 0, 1, NULL, '2019-12-13 03:57:02', NULL, '0000-00-00 00:00:00', NULL, NULL),
  (2, NULL, 'Cheque', 'Cheque', 0, 1, NULL, '2019-12-13 03:57:02', NULL, '0000-00-00 00:00:00', NULL, NULL);
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `password_resets`
  --
  
  CREATE TABLE IF NOT EXISTS `password_resets` (
    `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    KEY `password_resets_email_index` (`email`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `pastor_board`
  --
  
  CREATE TABLE IF NOT EXISTS `pastor_board` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(22) DEFAULT NULL,
    `parent_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Post,2=News,3=Ads',
    `p_title` text,
    `p_description` text,
    `classified_type` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Buy,2=Sell',
    `p_category` bigint(22) DEFAULT NULL COMMENT 'Category from master_lookup table with pastor_board cat',
    `posted_date` datetime DEFAULT NULL,
    `contact_name` varchar(255) DEFAULT NULL,
    `contact_email` text,
    `contact_phone` varchar(20) DEFAULT NULL,
    `cost` varchar(20) DEFAULT NULL,
    `image_path` text,
    `location_id` bigint(22) DEFAULT NULL,
    `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Active,2-Inactive',
    `createdBy` int(11) NOT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` int(11) DEFAULT NULL,
    `updated_at` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` int(11) DEFAULT NULL,
    `deleted_at` datetime DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `payment_gateways`
  --
  
  CREATE TABLE IF NOT EXISTS `payment_gateways` (
    `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID Primary Key',
    `gateway_name` varchar(50) NOT NULL COMMENT 'name of the gateway',
    `active` varchar(1) NOT NULL COMMENT 'Status of the gateway',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
  
  --
  -- Dumping data for table `payment_gateways`
  --
  
  INSERT INTO `payment_gateways` (`id`, `gateway_name`, `active`) VALUES
  (1, 'Stripe', '1'),
  (2, 'Paypal', '1'),
  (3, 'Others', '1');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `payment_gateway_parameters`
  --
  
  CREATE TABLE IF NOT EXISTS `payment_gateway_parameters` (
    `parameter_id` int(11) NOT NULL AUTO_INCREMENT,
    `payment_gateway_id` int(11) NOT NULL,
    `parameter_name` varchar(50) NOT NULL,
    `validation_type` varchar(100) DEFAULT NULL COMMENT 'enter if specific validation is required except "required" validation',
    PRIMARY KEY (`parameter_id`),
    KEY `payment_gateways_payment_gateway_parameters_FK1` (`payment_gateway_id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
  
  --
  -- Dumping data for table `payment_gateway_parameters`
  --
  
  INSERT INTO `payment_gateway_parameters` (`parameter_id`, `payment_gateway_id`, `parameter_name`, `validation_type`) VALUES
  (1, 1, 'Public Key', 'text'),
  (2, 1, 'Secret Key', 'text'),
  (3, 2, 'Client Email Id', 'email');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `payment_mode`
  --
  
  CREATE TABLE IF NOT EXISTS `payment_mode` (
    `id` int(20) NOT NULL AUTO_INCREMENT,
    `pm_name` varchar(255) DEFAULT NULL,
    `pm_desc` text,
    `pm_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Active,2=Inactive',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `permissions`
  --
  
  CREATE TABLE IF NOT EXISTS `permissions` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) NOT NULL DEFAULT '0',
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=7 ;
  
  --
  -- Dumping data for table `permissions`
  --
  
  INSERT INTO `permissions` (`id`, `orgId`, `name`, `guard_name`, `created_at`, `updated_at`) VALUES
  (1, 0, 'Nextgen Checkin', 'web', '2019-05-05 02:51:47', '2019-05-05 02:51:47'),
  (2, 0, 'Member Directory', 'web', '2019-05-05 02:51:47', '2019-05-05 02:51:47'),
  (3, 0, 'Scheduling', 'web', '2019-05-05 02:51:47', '2019-05-05 03:43:48'),
  (4, 0, 'Event management', 'web', '2019-05-05 02:51:47', '2019-05-05 02:51:47'),
  (5, 0, 'Small Group', 'web', '2019-05-05 03:30:09', '2019-05-05 03:38:33'),
  (6, 0, 'Accounting', 'web', '2019-05-05 03:30:21', '2019-05-05 03:38:37');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `position`
  --
  
  CREATE TABLE IF NOT EXISTS `position` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(22) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `resources`
  --
  
  CREATE TABLE IF NOT EXISTS `resources` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgId` int(11) NOT NULL,
    `item_name` varchar(255) DEFAULT NULL,
    `category_id` bigint(20) DEFAULT NULL,
    `item_desc` text,
    `location_id` bigint(20) DEFAULT NULL,
    `item_year` int(11) DEFAULT NULL,
    `item_model` varchar(100) DEFAULT NULL,
    `last_service_date` date DEFAULT NULL,
    `next_service_date` date DEFAULT NULL,
    `notification_period` varchar(200) NOT NULL,
    `item_photo` text,
    `coa` varchar(150) DEFAULT NULL,
    `rod` varchar(150) DEFAULT NULL,
    `approval_group` int(20) DEFAULT NULL COMMENT 'From ''roles'' table role id resepective of orgId',
    `quantity` int(20) DEFAULT NULL,
    `room_id` bigint(20) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `roles`
  --
  
  CREATE TABLE IF NOT EXISTS `roles` (
    `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) DEFAULT '0',
    `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `guard_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `role_tag` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=13 ;
  
  --
  -- Dumping data for table `roles`
  --
  
  INSERT INTO `roles` (`id`, `orgId`, `name`, `guard_name`, `role_tag`, `created_at`, `updated_at`) VALUES
  (1, 0, 'Super Adminin', 'web', 'superadmin', '2019-05-04 21:22:07', '2019-05-04 21:22:07'),
  (2, 0, 'Adminstrator', 'web', 'admin', '2019-05-04 21:22:08', '2019-08-24 15:57:41'),
  (3, 0, 'Member', 'web', 'member', '2019-05-04 22:20:10', '2019-05-04 22:20:10'),
  (4, 0, 'Volunteer', 'web', 'volunteer', '2019-07-25 17:48:18', '2019-07-25 17:48:18'),
  (5, 0, 'Pastor', 'web', 'pastor', '2019-08-24 15:59:13', '2019-09-12 19:52:59'),
  (6, 0, 'First Time Guest', 'web', 'firsttimeguest', '2019-08-24 15:59:13', '2019-09-12 19:52:59'),
  (7, 0, 'Inactive Member', 'web', 'InactiveMember', '2019-08-24 15:59:52', '2019-09-12 19:52:59'),
  (8, 0, 'Checkin Volunteer', 'web', 'CheckinVolunteer', '2019-08-24 15:59:52', '2019-09-12 19:52:59'),
  (9, 0, 'Event Organizer', 'web', 'EventOrganizer', '2019-08-24 16:00:12', '2019-09-12 19:52:59'),
  (10, 0, 'Production Manager', 'web', 'ProductionManager', '2019-08-24 16:00:12', '2019-09-12 19:52:59'),
  (11, 0, 'Accounts Admin', 'web', 'AccountsAdmin', '2019-08-24 16:00:29', '2019-09-12 19:52:59'),
  (12, 0, 'Visitor', 'web', 'Visitor', '2019-08-24 16:00:29', '2019-09-12 19:52:59');
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `role_has_permissions`
  --
  
  CREATE TABLE IF NOT EXISTS `role_has_permissions` (
    `permission_id` int(10) unsigned NOT NULL,
    `role_id` int(10) unsigned NOT NULL,
    PRIMARY KEY (`permission_id`,`role_id`),
    KEY `role_has_permissions_role_id_foreign` (`role_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `rooms`
  --
  
  CREATE TABLE IF NOT EXISTS `rooms` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `orgId` int(11) NOT NULL,
    `room_name` varchar(255) DEFAULT NULL,
    `room_owner` varchar(255) DEFAULT NULL,
    `contact_no` varchar(20) DEFAULT NULL,
    `contact_email` varchar(255) DEFAULT NULL,
    `room_desc` text,
    `room_image` text,
    `group_id` bigint(20) DEFAULT NULL,
    `building_number` varchar(150) DEFAULT NULL,
    `approval_group` int(20) DEFAULT NULL COMMENT 'From ''''roles'''' table role id resepective of orgId',
    `room_status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Active,2=Inactive',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
   
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `schedules`
  --
  
  CREATE TABLE IF NOT EXISTS `schedules` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `s_title` text,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `schedule_service_users_count`
  --
  
  CREATE TABLE IF NOT EXISTS `schedule_service_users_count` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(22) DEFAULT NULL,
    `scheduling_id` bigint(22) DEFAULT NULL,
    `team_id` bigint(22) DEFAULT NULL,
    `service_id` bigint(22) DEFAULT NULL,
    `user_count` int(10) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `scheduling`
  --
  
  CREATE TABLE IF NOT EXISTS `scheduling` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) DEFAULT NULL,
    `orgId` bigint(22) NOT NULL,
    `event_date` date DEFAULT NULL,
    `event_id` bigint(22) DEFAULT NULL,
    `is_manual_schedule` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1=Auto scheduling, 2=Manual Scheduling',
    `assign_ids` text,
    `notification_flag` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=None,2=SMS,3=Email,4=Both',
    `team_id` bigint(22) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
   
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `scheduling_user`
  --
  
  CREATE TABLE IF NOT EXISTS `scheduling_user` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(22) NOT NULL,
    `scheduling_id` bigint(22) NOT NULL,
    `team_id` bigint(22) DEFAULT NULL,
    `position_id` bigint(22) DEFAULT NULL,
    `user_id` bigint(22) DEFAULT NULL,
    `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Pending, 2=Accepted, 3=Decline',
    `token` varchar(255) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `store_payment_gateway_values`
  --
  
  CREATE TABLE IF NOT EXISTS `store_payment_gateway_values` (
    `payment_values_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID Primary Key',
    `orgId` bigint(20) DEFAULT NULL COMMENT 'Foreign key reference to organization',
    `payment_gateway_id` int(11) NOT NULL,
    `payment_gateway_parameter_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Foreign key reference to payment_gateway_parameters',
    `payment_gateway_parameter_value` varchar(200) NOT NULL COMMENT 'Values of the parameter to be passed to payment gateway',
    `active` varchar(1) NOT NULL DEFAULT '1' COMMENT 'Record status',
    `preferred_payment_gateway` int(1) NOT NULL DEFAULT '0' COMMENT '0 -> inactive, 1 - active',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`payment_values_id`),
    KEY `orgId` (`orgId`) USING BTREE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `store_payment_transactions`
  --
  
  CREATE TABLE IF NOT EXISTS `store_payment_transactions` (
    `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID Primary Key',
    `orgId` bigint(20) DEFAULT NULL COMMENT 'Foreign key reference to organization',
    `student_id` int(11) NOT NULL COMMENT 'Foreign key reference to student_id for which students the dues are paid',
    `student_personal_info_id` int(11) NOT NULL COMMENT 'student personal info id to track payments for each student',
    `user_type` int(11) NOT NULL DEFAULT '1' COMMENT '1=>STUDENT,2=>JUDGE',
    `payment_fees_id` int(11) DEFAULT NULL COMMENT 'payment done for',
    `payment_gateway_id` int(11) NOT NULL DEFAULT '0' COMMENT '0 -> none',
    `transaction_date` datetime DEFAULT NULL COMMENT 'Date on which transaction was done',
    `transaction_status` tinyint(1) DEFAULT NULL COMMENT 'Status of transaction 1 => submitted, 2 = > confirmed 3=> declined/error',
    `customer_id` varchar(50) DEFAULT NULL COMMENT 'customer_id response sent from payment gateway',
    `token_id` varchar(50) DEFAULT NULL COMMENT 'token id from payment Gateway',
    `payment_type` int(1) DEFAULT NULL COMMENT '1 => payment gateway, 2 => Check , 3 => Cash, 4=> purchase order, 5 => other',
    `other` varchar(250) DEFAULT NULL,
    `note` varchar(250) DEFAULT NULL,
    `manual_payment_details` varchar(250) DEFAULT NULL COMMENT 'if the payment is done via cash/cheque then related details will be saved here',
    `payment_gateway_return_data` mediumtext COMMENT 'Payment gateway return/postback data',
    `amount_paid` decimal(10,2) DEFAULT NULL COMMENT 'Amount already paid',
    `admin_status` tinyint(1) DEFAULT NULL COMMENT 'Status of transaction 0 => none 1 => submitted, 2 = > confirmed 3=> declined/error',
    `final_payment_flag` enum('0','1') NOT NULL DEFAULT '1' COMMENT '0=>Old payment,1=>Final payment',
    `submit_date` datetime DEFAULT NULL,
    `confirm_date` datetime DEFAULT NULL,
    `modified_by` int(11) NOT NULL DEFAULT '0',
    `modified_user_type` varchar(25) DEFAULT NULL,
    `last_updated_datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `student_individual_payment_status` int(11) NOT NULL DEFAULT '0' COMMENT 'student individual payment status',
    `st_type` int(11) NOT NULL DEFAULT '1' COMMENT 'Student ordering for team student, default it will be 1',
    `rule_show_flag` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Not Shown,2=Rule Shown',
    PRIMARY KEY (`id`),
    KEY `region_id` (`orgId`),
    KEY `payment_fees_id` (`payment_fees_id`),
    KEY `payment_gateway_id` (`payment_gateway_id`),
    KEY `student_id` (`student_id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tags`
  --
  
  CREATE TABLE IF NOT EXISTS `tags` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `tagGroup_id` bigint(22) DEFAULT NULL,
    `name` varchar(100) DEFAULT NULL,
    `order` tinyint(10) NOT NULL DEFAULT '0' COMMENT 'Listing order number for sorting',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `tag_groups`
  --
  
  CREATE TABLE IF NOT EXISTS `tag_groups` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(22) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `isPublic` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Public, 0=Restricted',
    `isMultiple_select` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1=Multiple select, 0=single',
    `order` tinyint(10) NOT NULL DEFAULT '0' COMMENT 'Listing order number for sorting',
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
   
  
  --
  -- Table structure for table `team`
  --
  
  CREATE TABLE IF NOT EXISTS `team` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(22) DEFAULT NULL,
    `name` varchar(255) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `team_has_position`
  --
  
  CREATE TABLE IF NOT EXISTS `team_has_position` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `team_id` bigint(22) DEFAULT NULL,
    `position_id` bigint(22) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `users`
  --
  
  CREATE TABLE IF NOT EXISTS `users` (
    `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    `orgId` bigint(20) DEFAULT NULL,
    `householdName` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `personal_id` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `name_prefix` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `given_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `first_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `last_name` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `middle_name` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `nick_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `full_name` text COLLATE utf8mb4_unicode_ci,
    `user_full_name` text COLLATE utf8mb4_unicode_ci,
    `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `username` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `email_verified_at` timestamp NULL DEFAULT NULL,
    `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
    `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `referal_code` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `name_suffix` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `profile_pic` text COLLATE utf8mb4_unicode_ci,
    `dob` date DEFAULT NULL,
    `doa` date DEFAULT NULL,
    `school_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `grade_id` bigint(20) DEFAULT NULL,
    `life_stage` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT 'Adult' COMMENT 'Adult,Child',
    `mobile_no` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `home_phone_no` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `gender` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `social_profile` text COLLATE utf8mb4_unicode_ci,
    `marital_status` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `address` text COLLATE utf8mb4_unicode_ci,
    `medical_note` text COLLATE utf8mb4_unicode_ci,
    `congregration_status` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `created_at` timestamp NULL DEFAULT NULL,
    `updated_at` timestamp NULL DEFAULT NULL,
    `deletedBy` text COLLATE utf8mb4_unicode_ci,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci AUTO_INCREMENT=1 ;
  
  -- --------------------------------------------------------
  
  --
  -- Table structure for table `user_has_position`
  --
  
  CREATE TABLE IF NOT EXISTS `user_has_position` (
    `id` bigint(22) NOT NULL AUTO_INCREMENT,
    `orgId` bigint(22) DEFAULT NULL,
    `user_id` bigint(22) DEFAULT NULL,
    `position_id` bigint(22) DEFAULT NULL,
    `createdBy` text,
    `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `updatedBy` text,
    `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP,
    `deletedBy` text,
    `deleted_at` timestamp NULL DEFAULT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  
  --
  -- Constraints for dumped tables
  --
  
  --
  -- Constraints for table `model_has_permissions`
  --
  ALTER TABLE `model_has_permissions`
    ADD CONSTRAINT `model_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `model_has_roles`
  --
  ALTER TABLE `model_has_roles`
    ADD CONSTRAINT `model_has_roles_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
  
  --
  -- Constraints for table `role_has_permissions`
  --
  ALTER TABLE `role_has_permissions`
    ADD CONSTRAINT `role_has_permissions_permission_id_foreign` FOREIGN KEY (`permission_id`) REFERENCES `permissions` (`id`) ON DELETE CASCADE,
    ADD CONSTRAINT `role_has_permissions_role_id_foreign` FOREIGN KEY (`role_id`) REFERENCES `roles` (`id`) ON DELETE CASCADE;
  