hackforla / peopledepot

A project to setup a datastore for people and projects at HackforLA. The link below takes you to the code documentation
https://hackforla.github.io/peopledepot/
GNU General Public License v2.0
5 stars 24 forks source link

Change all instances of recurring_event in the code to event #209

Closed anandramakris closed 8 months ago

anandramakris commented 9 months ago

Fixes #173

What changes did you make?

Why did you make the changes (we will use this info to test)?

Screenshots of Proposed Changes Of The Website (if any, please do not screen shot code changes)]

Visuals before changes are applied ![image]( before )
Visuals after changes are applied ![image]( after )
anandramakris commented 9 months ago

I didn't get the "core_event does not exist" error at all, thanks for noticing on your end.

I did get the "raise InconsistentMigrationHistory" error, but it did not seem to cause any problems with the table name change.

anandramakris commented 9 months ago

Tested right now on my end if the migration error still occurs and it just says "No migrations to apply."

fyliu commented 9 months ago

Just commenting.

We probably don't need to change the "add model" guide since it references the create recurring_event table issue. It's still working on the table it's supposed to create. We might add a note that the table may have changed, and maybe link to the issue #173 that this PR is for.

I'm guessing the error might be caused by switching to a branch with a different history than the one that created the local database. If that's the case, rolling back to a common ancestor migration before switching branches should solve it. Or, if we don't care about the local database, just delete it with docker-compose down -v to delete the data volume.

anandramakris commented 8 months ago

Seems to be that when I try to run a new container with the old migrations but my model name changes, it creates a new migrations file called 0015_rename_recurringevent_event.py. I assume this is what you were talking about @fyliu

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('core', '0014_language'),
    ]

    operations = [
        migrations.RenameModel(
            old_name='RecurringEvent',
            new_name='Event',
        ),
    ]
fyliu commented 8 months ago

@anandramakris yes, exactly. We should let it generate a new migration for the change.

AzaniaBG commented 8 months ago

@anandramakris @fyliu ~ I requested changes. Anand, can you edit your commit message to add the changes you made using this templatethis pull request template?

Also, the force commit has caused an issue that makes it difficult to find the commit on the branch. For example, I see a message that the commit does not belong to a branch on the repo when clicking the GH email commit link to get to your latest commit. Also, when I navigate to issue #209, I see a message that the commits can't be found (see screenshots below).

Screenshot 2023-10-25 at 6 34 26 AM

Screenshot 2023-10-25 at 6 31 16 AM

anandramakris commented 8 months ago

Have changed the commit message.