Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model db_table #53

Closed
jsguerrero opened this issue Jul 6, 2021 · 1 comment
Closed

model db_table #53

jsguerrero opened this issue Jul 6, 2021 · 1 comment

Comments

@jsguerrero
Copy link

Hi!

I'm create a model, but it does not respect the name that I assign from the meta method.

models.py

class TeenusProducts(models.Model):
    class Meta:
        db_table = 'teenus_products'

python manage.py sqlmigrate users 0001

--
-- Create model TeenusProducts
--
CREATE TABLE [users_teenusproducts]

I expected table name users_teenus_products

Thanks!

@absci
Copy link
Contributor

absci commented Jul 8, 2021

Hi, I couldn't reproduce your issue. Could you check your migration file for this model.
It should have something like this

class Migration(migrations.Migration):

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='',
            fields=[
            ],
            options={
                'db_table': '', # <-- Does this name match what's in the models.py?
            },
        ),
    ]

@absci absci closed this as completed Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants