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

feat: add updatedAt field; order projects by last update time #219

Merged
merged 2 commits into from
Feb 26, 2023

Conversation

lihebi
Copy link
Collaborator

@lihebi lihebi commented Feb 25, 2023

Now each project (repository) will record the updatedAt and createdAt fields. The project list will be ordered based on last update time, with most recent showing first.

Screenshot 2023-02-25 at 11 58 30 AM

@lihebi lihebi changed the title add updatedAt field add updatedAt field; order projects by last update time Feb 25, 2023
@lihebi lihebi changed the title add updatedAt field; order projects by last update time feat: add updatedAt field; order projects by last update time Feb 25, 2023
@lihebi
Copy link
Collaborator Author

lihebi commented Feb 26, 2023

Update:

  1. Use "last viewed" instead of "last updated" to sort the projects, the same behavior as Google Docs.
  2. In DB schema, the data is stored in a UserRepoData table with one entry for each <user,repo> pair, so that each user owns a different setting for each repo.
model UserRepoData {
    id         String   @id
    user       User     @relation(fields: [userId], references: [id])
    userId     String
    repo       Repo     @relation(fields: [repoId], references: [id])
    repoId     String
    accessedAt DateTime @default(now()) @updatedAt
    dummyCount Int      @default(0)
}

@lihebi lihebi merged commit b0f391d into codepod-io:main Feb 26, 2023
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

Successfully merging this pull request may close these issues.

1 participant