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

Add updated at column #66

Merged
merged 14 commits into from
Nov 1, 2024
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/packages-license.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# giselle

As of October 29, 2024 10:23am. 926 total
As of October 31, 2024 8:07am. 926 total
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this change is unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There were no changes to the dependencies, but since bun.lockb was included in the early commit, that file was automatically updated. I reverted it because it is unnecessary. thank you. cb4dad8


## Summary
* 667 MIT
Expand Down
12 changes: 12 additions & 0 deletions drizzle/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export const organizations = pgTable("organizations", {
dbId: serial("db_id").primaryKey(),
name: text("name").notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at")
.defaultNow()
.notNull()
.$onUpdate(() => new Date()),
});

export const subscriptions = pgTable("subscriptions", {
Expand Down Expand Up @@ -75,6 +79,10 @@ export const teams = pgTable("teams", {
.references(() => organizations.dbId),
name: text("name").notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at")
.defaultNow()
.notNull()
.$onUpdate(() => new Date()),
});

export type UserId = `usr_${string}`;
Expand Down Expand Up @@ -138,6 +146,10 @@ export const agents = pgTable("agents", {
}),
graphHash: text("graph_hash").unique(),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at")
.defaultNow()
.notNull()
.$onUpdate(() => new Date()),
});

export const builds = pgTable("builds", {
Expand Down
3 changes: 3 additions & 0 deletions migrations/0005_smart_vapor.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE "agents" ADD COLUMN "updated_at" timestamp DEFAULT now() NOT NULL;--> statement-breakpoint
ALTER TABLE "organizations" ADD COLUMN "updated_at" timestamp DEFAULT now() NOT NULL;--> statement-breakpoint
ALTER TABLE "teams" ADD COLUMN "updated_at" timestamp DEFAULT now() NOT NULL;
Loading