mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-19 16:16:45 +00:00
fix(oracle): preserve column parameters and OceanBase table clones
This commit is contained in:
@@ -115,6 +115,14 @@ description: 可视化查看和修改字段、索引、外键与触发器,并
|
||||
|
||||
不要根据“能连接”推断“所有 DDL 都能编辑”。当前范围以 [数据库支持](/cn/docs/databases) 和编辑器实际控件为准。
|
||||
|
||||
## OceanBase Oracle 表结构克隆
|
||||
|
||||
侧栏和对象浏览器中的「克隆表结构」及结构粘贴使用同一复制范围:列类型及参数、BYTE/CHAR 长度单位、默认值、可空性、主键列序、普通索引和表列注释。`FLOAT(p)` 的二进制精度与 `NUMBER(*,s)`、负 scale 会保留。OceanBase 的内置类型推荐基于 4.2.5.7 的建列验证;其他版本仍可手动输入类型,已有字段类型不会被推荐列表替换。
|
||||
|
||||
执行前的确认框展示目标、SQL、复制项和排除项。外键、CHECK/UNIQUE 约束、触发器、特殊索引和分区定义不复制;UNIQUE 约束的支撑索引也排除,独立普通唯一索引可以复制。含虚拟列或临时表属性的源表会被拒绝。普通目标名按大写处理;显式双引号名称保留大小写,例如 `orders_copy` 创建 `ORDERS_COPY`,`"OrdersCopy"` 创建 `OrdersCopy`。
|
||||
|
||||
DDL 逐条提交,遇到首个错误即停止,不自动回滚或删除目标。失败详情分别列出已确认成功、数据库拒绝或结果未知,以及尚未执行的步骤。重试前,按详情中的 schema 和表名刷新并核对目标结构;通信中断不能证明建表失败。原生 Oracle 的克隆范围保持独立,不受上述 OceanBase 排除规则限制。
|
||||
|
||||
## 并发与恢复
|
||||
|
||||
- 编辑草稿基于打开时读取的元数据,不会自动合并其他客户端的结构变更
|
||||
|
||||
@@ -115,6 +115,14 @@ Copy the complete DDL for code review or execution through a migration tool.
|
||||
|
||||
Do not assume that every DDL feature is editable because a database can connect. Use [Database Support](/en/docs/databases) and the actual editor controls as the current source of truth.
|
||||
|
||||
## OceanBase Oracle Structure Cloning
|
||||
|
||||
The sidebar and Object Browser use the same scope for structure cloning and structure paste: column types and parameters, BYTE/CHAR units, defaults, nullability, primary-key column order, ordinary indexes, and table/column comments. FLOAT binary precision and NUMBER star precision or negative scale are retained. Built-in OceanBase type recommendations use CREATE-column checks against 4.2.5.7; other types can still be entered manually, and recommendations do not replace existing column types.
|
||||
|
||||
Before execution, confirmation shows the target, SQL, copied items, and exclusions. Foreign keys, CHECK/UNIQUE constraints, triggers, special indexes, and partition definitions are excluded. UNIQUE constraint backing indexes are excluded too; independent ordinary unique indexes can be copied. Sources with virtual columns or temporary-table properties are rejected. Ordinary target names fold to uppercase, while explicitly double-quoted names retain case: `orders_copy` creates `ORDERS_COPY`, and `"OrdersCopy"` creates `OrdersCopy`.
|
||||
|
||||
Each DDL statement commits separately. Execution stops at the first error without automatic rollback or target deletion. Failure details distinguish confirmed steps, database rejection or unknown results, and steps not executed. Before retrying, refresh and inspect the target using the reported schema and table name; a lost response does not prove creation failed. Native Oracle cloning retains its own scope and is not restricted by these OceanBase exclusions.
|
||||
|
||||
## Concurrency and Recovery
|
||||
|
||||
- Drafts are based on metadata read when the editor opened and do not merge external schema changes automatically
|
||||
|
||||
Reference in New Issue
Block a user