Skip to content

Adding timestamp to feature use model#66

Draft
rboston628 wants to merge 1 commit intomainfrom
mtdev23-add-timestamp
Draft

Adding timestamp to feature use model#66
rboston628 wants to merge 1 commit intomainfrom
mtdev23-add-timestamp

Conversation

@rboston628
Copy link

This PR will add a timestamp to the feature use model.

The goal is to be able to separate out feature usages by time.

Because feature use seems to be an aggregate, I'm unsure of exactly how this will work.

This is a work in progress, and requires more experimentation to ensure correct behavior.

@rboston628
Copy link
Author

This needs the migration file. According to @mpatrou this is set up automatically during the build, but I wasn't sure how to initialize it

@sf1919
Copy link
Contributor

sf1919 commented Oct 18, 2023

@robertapplin and @MialLewis can you help with Staging Server?

@robertapplin
Copy link
Contributor

We might need to add the new column to the admin.py file so we can see it on the admin database page

class UsageAdmin(admin.ModelAdmin):

@robertapplin robertapplin self-assigned this Oct 23, 2023
@robertapplin
Copy link
Contributor

robertapplin commented Oct 23, 2023

@rboston628 what do we want to use as the default timestamp? When testing the migration locally with

docker-compose exec web python manage.py makemigrations
docker-compose exec web python manage.py migrate

I get the following message:

You are trying to add the field 'timestamp' with 'auto_now_add=True' to featureusage without a default; the database needs something to populate existing rows.

 1) Provide a one-off default now (will be set on all existing rows)
 2) Quit, and let me add a default in models.py

@sf1919
Copy link
Contributor

sf1919 commented Sep 3, 2025

@rboston628 is this PR still live or should we just close it?

@github-actions github-actions bot added the Has Conflicts Used by the bot to label pull requests that have conflicts label Sep 16, 2025
@github-actions
Copy link

👋 Hi, @rboston628,

Conflicts have been detected against the base branch. Please rebase your branch against the base branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Has Conflicts Used by the bot to label pull requests that have conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants