backdrop-contrib / ip_blocking

Enables blocking of IP addresses.
GNU General Public License v2.0
0 stars 2 forks source link

Table blocked_ips already exists - when upgrading from Drupal 7 #5

Closed herbdool closed 3 years ago

herbdool commented 3 years ago

DatabaseSchemaObjectExistsException: Table blocked_ips already exists. in DatabaseSchema->createTable() (line 661 of /app/core/includes/database/schema.inc).

Not sure how to avoid this when there's a schema in the install file. Somehow need to check if the table already exists.

herbdool commented 3 years ago

The fatal error interrupts the update hooks. And the schema version ends up staying at -1 in the system table so it can't run the updates at all.

findlabnet commented 3 years ago

Seems like checking for existing table need to be added to installer.

findlabnet commented 3 years ago

Trying resolve it as core issue

herbdool commented 3 years ago

Thanks for doing that @findlabnet. You can probably close this issue then. (In retrospect I could have just renamed the table if I wanted to keep the data.)

findlabnet commented 3 years ago

Resolved with new release If old table exists when this module install, it will be renamed to blocked_ips_d7, then on status report page you can see info about it. @herbdool , thanks for your help.