CHECK constraints being renamed to MySQL defaults

オープン
#1,341 コメント 2 件 リアクション 3 件 担当者 0 名 GitHub で見る

メンテナーはふだん 10 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
go, mysql
領域
databases

調査の方向性

go/logic/applier.go の223行目付近から始め、migration が置換テーブルをどのように作成するかを確認します。テーブル foo に名前付きの CHECK 制約がある報告されたケースを再現し、その後、migration されたテーブルが foo_check_1 のような生成名を受け取るのではなく、my_check_constraint を保持することを確認します。

索引モデルが issue の本文から書いたものです。

説明

gh-ost version: 1.1.6

We noticed when migrating tables with named CHECK constraints, they were renamed after the migration to the MySQL default names.

eg:
A CHECK constraint on a table foo named my_check_constraint is renamed to foo_check_1 after a gh-ost migration of table foo.

I suspect this is because it looks like gh-ost is using a CREATE TABLE ... LIKE stmt referenced here. CREATE TABLE ... LIKE will copy the CHECK constraints but generate their names. [src]

For CREATE TABLE ... LIKE, the destination table preserves CHECK constraints from the original table, except that all the constraint names are generated.

We'd like to keep these CHECK constraint names consistent if possible. Is this a feature that can be added in a future release or a welcomed PR?

Thanks for all of the great work on gh-ost!

主要言語
Go
スター
13.6k
フォーク
1.4k
平均マージ
9日 19時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/gh-ost のほかの issue

github/gh-ost の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。