Skip to content

Feature request: Support renaming tables/columns in declarative workflow #3636

@yoni-yad2

Description

@yoni-yad2

In order to not lose data in declarative mode, please support an attribute/directive for tables/columns called rename_as, so Atlas will rename table/column name x as y, instead of dropping/recreating it with a new name.

During planning, Atlas should also pre-check that no two tables have the same name/rename_as value in the same schema or same column name/rename_as value in the same table.

Example:

table "remarks_table" {
  schema = schema.myschema
  rename_as = "comments_table"
  column "ID" {
    null           = false
    type           = int
    unsigned       = true
    auto_increment = true
  }
  column "remarks" {
    rename_as = "comments"
    null = true
    type = varchar(250)
  }
  primary_key {
    columns = [column.ID]
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions