<commit_before>-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE `users` (
  `id`                INT UNSIGNED NOT NULL AUTO_INCREMENT
  COMMENT 'ID',
  `name`              VARCHAR(255)
  COMMENT 'ユーザー名',
  `email`             VARCHAR(255) NOT NULL
  COMMENT 'メールアドレス',
  `session_token`     VARCHAR(255) NOT NULL
  COMMENT 'セッショントークン',
  `token_expire`      TIMESTAMP    NOT NULL
  COMMENT 'トークン有効期限',
  `last_login_at`     TIMESTAMP    NOT NULL
  COMMENT '最終ログイン日時',
  `created_at`        TIMESTAMP    NOT NULL
  COMMENT '作成日時',
  `updated_at`        TIMESTAMP    NOT NULL
  COMMENT '更新日時',
  PRIMARY KEY (`id`),
  UNIQUE (`session_token`)
)
  ENGINE = InnoDB
  CHARSET = utf8;

CREATE TABLE auths (
  `id`         INT UNSIGNED NOT NULL AUTO_INCREMENT
  COMMENT 'ID',
  `user_id`    INT UNSIGNED NOT NULL
  COMMENT 'ユーザーID',
  `source`     VARCHAR(255) NOT NULL
  COMMENT '認証元',
  `source_id`  VARCHAR(255) NOT NULL
  COMMENT '認証元ユーザーID',
  `email`      VARCHAR(255) NOT NULL
  COMMENT 'メールアドレス',
  `created_at` TIMESTAMP    NOT NULL
  COMMENT '作成日時',
  `updated_at` TIMESTAMP    NOT NULL
  COMMENT '更新日時',
  PRIMARY KEY (`id`),
  UNIQUE (`user_id`, `source`)
)
  ENGINE = InnoDB
  CHARSET = utf8;


-- INSERT INTO `users`
-- (`created_at`, `updated_at`, `name`)
-- VALUES
--   (NOW(), NOW(), '田中'),
--   (NOW(), NOW(), '鈴木');


-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP TABLE IF EXISTS `users`;
DROP TABLE IF EXISTS `auths`;<commit_msg>mysql5.7対応<commit_after>-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE `users` (
  `id`            INT UNSIGNED NOT NULL AUTO_INCREMENT
  COMMENT 'ID',
  `name`          VARCHAR(255)
  COMMENT 'ユーザー名',
  `email`         VARCHAR(255)
  COMMENT 'メールアドレス',
  `session_token` VARCHAR(255)
  COMMENT 'セッショントークン',
  `token_expire`  TIMESTAMP             DEFAULT CURRENT_TIMESTAMP
  COMMENT 'トークン有効期限',
  `last_login_at` TIMESTAMP             DEFAULT CURRENT_TIMESTAMP
  COMMENT '最終ログイン日時',
  `created_at`    TIMESTAMP    NOT NULL DEFAULT CURRENT_TIMESTAMP
  COMMENT '作成日時',
  `updated_at`    TIMESTAMP    NOT NULL DEFAULT CURRENT_TIMESTAMP
  COMMENT '更新日時',
  PRIMARY KEY (`id`),
  UNIQUE (`session_token`)
)
  ENGINE = InnoDB
  CHARSET = utf8;

CREATE TABLE auths (
  `id`         INT UNSIGNED NOT NULL AUTO_INCREMENT
  COMMENT 'ID',
  `user_id`    INT UNSIGNED NOT NULL
  COMMENT 'ユーザーID',
  `source`     VARCHAR(255)
  COMMENT '認証元',
  `source_id`  VARCHAR(255)
  COMMENT '認証元ユーザーID',
  `email`      VARCHAR(255)
  COMMENT 'メールアドレス',
  `created_at` TIMESTAMP    NOT NULL DEFAULT CURRENT_TIMESTAMP
  COMMENT '作成日時',
  `updated_at` TIMESTAMP    NOT NULL DEFAULT CURRENT_TIMESTAMP
  COMMENT '更新日時',
  PRIMARY KEY (`id`),
  UNIQUE (`user_id`, `source`)
)
  ENGINE = InnoDB
  CHARSET = utf8;

-- +goose Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP TABLE IF EXISTS `users`;
DROP TABLE IF EXISTS `auths`;
{'fraction_non_alphanumeric': 0.11033333333333334, 'fraction_numerical': 0.014, 'mean_word_length': 3.0829931972789115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6944991', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1194, 'n_words': 320}