Base solution for your next web application
Open Closed

Remove abp prefix from table names #12519


User avatar
0
uenlkr4e created

Hi, I did add the following line in my db context OnModelCreating method

modelBuilder.ChangeAbpTablePrefix<Tenant, Role, User>("");

and added a new migration.

Then ran the migrator project to update the db, but getting the following error message and it happens on a newly installed system with no additional entities.

am i supposed to do something else?

thanks

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

1 Answer(s)
  • User Avatar
    0
    oguzhanagir created
    Support Team

    Hi @uenlkr4e

    If this is a clean system (no existing data):

    • Simply delete the database and run the migration again using the migrator or update-database.
    • EF will recreate all tables from scratch, including IDENTITY columns, without any issue.

    If you already have data or want to preserve the database:

    • Open the generated migration file and manually remove the part that tries to alter the IDENTITY column.
    • Alternatively, instead of renaming via migration, consider using raw SQL (sp_rename) if your goal is just to rename the tables.
    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)