text: CREATE SCHEMA `schemaB`;
  
  CREATE SCHEMA `ecommerce`;
  
  CREATE SCHEMA `schemaA`;
  
  CREATE TABLE `users` (
    `id` int PRIMARY KEY,
    `name` varchar(255),
    `pjs` ENUM ('created2', 'running2', 'done2', 'failure2'),
    `pjs2` ENUM ('created2', 'running2', 'done2', 'failure2'),
    `pg` ENUM ('male', 'female'),
    `pg2` ENUM ('male2', 'female2')
  );
  
  CREATE TABLE `products` (
    `id` int PRIMARY KEY,
    `name` varchar(255) COMMENT 'Product name'
  ) COMMENT = 'Notes about products table';
  
  CREATE TABLE `ecommerce`.`users` (
    `id` int PRIMARY KEY,
    `name` varchar(255),
    `ejs` ENUM ('created2', 'running2', 'done2', 'failure2'),
    `ejs2` ENUM ('created2', 'running2', 'done2', 'failure2'),
    `eg` ENUM ('male', 'female'),
    `eg2` ENUM ('male2', 'female2')
  ) COMMENT = 'Table users of schema ecommerce';
  
  CREATE TABLE `schemaA`.`products` (
    `id` int PRIMARY KEY,
    `name` varchar(255),
    `lid` int,
    CONSTRAINT `FK_1` FOREIGN KEY (`lid`) REFERENCES `schemaA`.`locations` (`id`) ON DELETE CASCADE
  );
  
  CREATE TABLE `schemaA`.`locations` (
    `id` int PRIMARY KEY,
    `name` varchar(255)
  );
  
  ALTER TABLE `ecommerce`.`users` ADD FOREIGN KEY (`id`) REFERENCES `users` (`id`);
  
  ALTER TABLE `ecommerce`.`users` ADD CONSTRAINT `name_optional` FOREIGN KEY (`id`) REFERENCES `users` (`name`);
  
  ALTER TABLE `schemaA`.`products` ADD FOREIGN KEY (`name`) REFERENCES `ecommerce`.`users` (`id`);
  
  ALTER TABLE `schemaA`.`locations` ADD FOREIGN KEY (`name`) REFERENCES `users` (`id`);
  