oceanbase / oceanbase

OceanBase is an enterprise distributed relational database with high availability, high performance, horizontal scalability, and compatibility with SQL standards.
https://open.oceanbase.com
Other
8.24k stars 1.65k forks source link

[Feature]: Support compound DDL statements #1828

Open mrzjzmars opened 7 months ago

mrzjzmars commented 7 months ago

在使用Django框架做模型的migration时,比如某张表新增了一个column,并且把这个字段与其他table做外键关联,此时django会自动生成一天执行语句。类似这种“ALTER TABLE erp_cangku_hc ADD COLUMN ck_id_test integer DEFAULT 1 NOT NULL , ADD CONSTRAINT erp_cangku_hc_ck_id_b0ed2312_fk_erp_cangku_id_test FOREIGN KEY (ck_id_test) REFERENCES erp_cangku(id)”,在oracle、mysql、已经PG都试过可以执行,但是在OB上,给出的提示是5021 - Column not found 。 希望在后续版本中能够增加这个支持。 image

hnwyllmm commented 7 months ago

收到。感谢反馈。你之前测试的MySQL版本是多少?另外,能帮忙把这个语句关联的表show create table发我一下吗?


receive. Thanks for the feedback. What version of MySQL did you test before? In addition, can you help me send the show create table table associated with this statement?

mrzjzmars commented 6 months ago

收到。感谢反馈。你之前测试的MySQL版本是多少?另外,能帮忙把这个语句关联的表show create table发我一下吗?发自我的 iPhone在 2024年2月7日,10:23,mrzjzmars @.> 写道: 在使用Django框架做模型的migration时,比如某张表新增了一个column,并且把这个字段与其他table做外键关联,此时django会自动生成一天执行语句。类似这种“ALTER TABLE erp_cangku_hc ADD COLUMN ck_id_test integer DEFAULT 1 NOT NULL , ADD CONSTRAINT erp_cangku_hc_ck_id_b0ed2312_fk_erp_cangku_id_test FOREIGN KEY (ck_id_test) REFERENCES erp_cangku(id)”,在oracle、mysql、已经PG都试过可以执行,但是在OB上,给出的提示是5021 - Column not found 。 希望在后续版本中能够增加这个支持。 image.png (view on web) —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.>

测试使用的MySQL版本是8.0.3 。两张表结构我放附件了。 表结构.zip