[FIX] base: Make user apikeys ondelete cascade on user_id
This could prevent the user deletion if linked to a record of this type, like a auth_totp.device which inherits from this model. Part-of: odoo/odoo#114656
This commit is contained in:
@@ -1990,7 +1990,7 @@ class APIKeys(models.Model):
|
||||
CREATE TABLE IF NOT EXISTS {table} (
|
||||
id serial primary key,
|
||||
name varchar not null,
|
||||
user_id integer not null REFERENCES res_users(id),
|
||||
user_id integer not null REFERENCES res_users(id) ON DELETE CASCADE,
|
||||
scope varchar,
|
||||
index varchar({index_size}) not null CHECK (char_length(index) = {index_size}),
|
||||
key varchar not null,
|
||||
|
||||
Reference in New Issue
Block a user