Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
lolopinto committed Jul 29, 2022
1 parent ba25843 commit 204edba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions examples/todo-sqlite/src/schema/global_schema.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
import { GlobalSchema, TimestampType } from "@snowtop/ent/schema/";
import * as clause from "@snowtop/ent/core/clause";
import {
Ent,
UpdateOperation,
TransformedUpdateOperation,
SQLStatementOperation,
} from "@snowtop/ent";
import { GlobalDeletedEdge } from "@snowtop/ent-soft-delete";

const glo: GlobalSchema = {
Expand Down
7 changes: 7 additions & 0 deletions ts/packages/ent-soft-delete/src/soft_delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ export class DeletedAtPattern implements Pattern {
}

export const GlobalDeletedEdge = {
extraEdgeFields: {
deleted_at: TimestampType({
nullable: true,
defaultValueOnCreate: () => null,
}),
},

transformEdgeRead(): clause.Clause {
return clause.Eq("deleted_at", null);
},
Expand Down

0 comments on commit 204edba

Please sign in to comment.