Skip to content

Commit

Permalink
rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
adamsoffer committed Nov 11, 2021
1 parent e9633b2 commit 45d7c4e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cmd/filecoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ const filecoinImport = async () => {
// Get last imported id: we will start importing from there
const project = await getProject(coin.name);

// Delete project if delete: True
const deleteProject = project.delete;
if (deleteProject) {
await prisma.project.update({
where: {
name: coin.name,
},
data: {
delete: false,
lastImportedId: "0",
},
});
}

const response = await axios
.get(endpoint, {
params: params,
Expand Down
2 changes: 2 additions & 0 deletions prisma/migrations/20211111145631_add_delete/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Project" ADD COLUMN "delete" BOOLEAN;
1 change: 1 addition & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ model Project {
name String @unique
lastImportedId String
days Day[]
delete Boolean?
}

model Day {
Expand Down

1 comment on commit 45d7c4e

@vercel
Copy link

@vercel vercel bot commented on 45d7c4e Nov 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.