• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OCA / openupgradelib / 714

Build:
Build:
LAST BUILD BRANCH: add_fields-default
DEFAULT BRANCH: master
Ran 20 Mar 2020 09:44AM UTC
Jobs 1
Files 0
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
714

Pull #201

travis-ci

web-flow
[FIX] rename constraints and indexes when renaming table

For example, [in OpenUpgrade v9, the table `crm_case_section` is renamed to `crm_team`][1], but after that migration, the `crm_team` table still has these indexes and constraints (obtained from psql with `\d crm_team`):

```
Indexes:
    "crm_case_section_pkey" PRIMARY KEY, btree (id)
    "crm_case_section_code_uniq" UNIQUE CONSTRAINT, btree (openupgrade_legacy_10_0_code)
    "crm_team_code_uniq" UNIQUE CONSTRAINT, btree (openupgrade_legacy_10_0_code)
    "crm_team_message_main_attachment_id_index" btree (message_main_attachment_id)
Foreign-key constraints:
    "crm_case_section_alias_id_fkey" FOREIGN KEY (alias_id) REFERENCES mail_alias(id) ON DELETE RESTRICT
    "crm_case_section_create_uid_fkey" FOREIGN KEY (create_uid) REFERENCES res_users(id) ON DELETE SET NULL
    "crm_case_section_parent_id_fkey" FOREIGN KEY (parent_id) REFERENCES crm_team(id) ON DELETE SET NULL
    "crm_case_section_resource_calendar_id_fkey" FOREIGN KEY (resource_calendar_id) REFERENCES resource_calendar(id) ON DELETE SET NULL
    "crm_case_section_user_id_fkey" FOREIGN KEY (user_id) REFERENCES res_users(id) ON DELETE SET NULL
    "crm_case_section_write_uid_fkey" FOREIGN KEY (write_uid) REFERENCES res_users(id) ON DELETE SET NULL
    "crm_team_company_id_fkey" FOREIGN KEY (company_id) REFERENCES res_company(id) ON DELETE SET NULL
    "crm_team_message_main_attachment_id_fkey" FOREIGN KEY (message_main_attachment_id) REFERENCES ir_attachment(id) ON DELETE SET NULL
```

As you can see, indexes and constraints are still prefixed with `crm_case_section_`.

After this patch, those will be properly prefixed.

@Tecnativa TT23037

[1]: https://github.com/OCA/OpenUpgrade/blob/86e142e9a/addons/sales_team/migrations/9.0.1.0/pre-migration.py#L25
Pull Request #201: [FIX] rename constraints and indexes when renaming table
Jobs
ID Job ID Ran Files Coverage
1 714.1 20 Mar 2020 09:44AM UTC 0
Travis Job 714.1
Source Files on build 714
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #714
  • Pull Request #201
  • PR Base - master (#713)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc