-- migration: create Session table (MySQL / MariaDB compatible)
CREATE TABLE IF NOT EXISTS `Session` (
  `id` VARCHAR(191) NOT NULL,
  `shop` VARCHAR(255) NOT NULL,
  `state` VARCHAR(255) NOT NULL,
  `isOnline` TINYINT(1) NOT NULL DEFAULT 0,
  `scope` TEXT,
  `expires` DATETIME NULL,
  `accessToken` TEXT NOT NULL,
  `userId` BIGINT NULL,
  `firstName` VARCHAR(255) NULL,
  `lastName` VARCHAR(255) NULL,
  `email` VARCHAR(255) NULL,
  `accountOwner` TINYINT(1) NOT NULL DEFAULT 0,
  `locale` VARCHAR(50) NULL,
  `collaborator` TINYINT(1) DEFAULT 0,
  `emailVerified` TINYINT(1) DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
