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

ID -> id #1763

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Changelog for the docker image are [here](/docker_CHANGELOG.md).

## [Unreleased]

## [0.2.0-alpha.2] - 2024-02-23

- change id in default pattern from `ID` to `id` (#1763)
* references to `ID` in say foreign key definitions will have to be updated

## [0.2.0-alpha.1] - 2024-02-22

### Breaking
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/core-concepts/ent-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ For an [indexed foreign key](/docs/ent-schema/fields#foreignkey) or an [index](/
```ts title="src/schema/contact_schema.ts"
const ContactSchema = new EntSchema({
fields: {
userID: UUIDType({ foreignKey: { schema: "User", column: "ID" } }),
userID: UUIDType({ foreignKey: { schema: "User", column: "id" } }),
},
});
export const ContactSchema;
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/custom-data-access/custom-queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const TodoSchema = new EntSchema({
},
}),
creatorID: UUIDType({
foreignKey: { schema: "Account", column: "ID" },
foreignKey: { schema: "Account", column: "id" },
}),
},
});
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/ent-schema/constraints.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ However, to add a multi-column constraint:
const GuestSchema = new EntSchema({
fields: [
eventID: UUIDType({
foreignKey: { schema: "Event", column: "ID" },
foreignKey: { schema: "Event", column: "id" },
}),
emailAddress: EmailType({ nullable: true }),
],
Expand Down Expand Up @@ -101,7 +101,7 @@ const UserSchema = new EntSchema({
{
name: "user_uniqueEmail",
type: ConstraintType.Unique,
columns: ["ID", "EmailAddress"],
columns: ["id", "EmailAddress"],
},
],
});
Expand All @@ -125,7 +125,7 @@ const ContactSchema = new EntSchema({
fkey: {
tableName: "users",
ondelete: "CASCADE",
columns: ["ID", "EmailAddress"],
columns: ["id", "EmailAddress"],
}
},
],
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/ent-schema/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Adds an index on this column to the database.
Adds a foreign key to another column in another table.

```ts
creatorID: UUIDType({ foreignKey: { schema: "User", column: "ID" } }),
creatorID: UUIDType({ foreignKey: { schema: "User", column: "id" } }),
```

adds a foreignKey on the `creator_id` column on the source table that references the `id` column in the `users` table.
Expand Down Expand Up @@ -178,7 +178,7 @@ This can be used to compute a value at runtime. For example, to default to the [

```ts
creatorID: UUIDType({
foreignKey: { schema: "Account", column: "ID" },
foreignKey: { schema: "Account", column: "id" },
defaultValueOnCreate: (builder) => builder.viewer.viewerID,
}),
```
Expand All @@ -199,14 +199,14 @@ Boolean. Shorthand to default to the viewer when creating an object if field not

```ts
creatorID: UUIDType({
foreignKey: { schema: "Account", column: "ID" },
foreignKey: { schema: "Account", column: "id" },
defaultToViewerOnCreate: true,
}),
```

```ts
creatorID: UUIDType({
foreignKey: { schema: "Account", column: "ID" },
foreignKey: { schema: "Account", column: "id" },
defaultValueOnCreate: (builder) => builder.viewer.viewerID,
}),
```
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/loaders/query-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const TodoSchema = new EntSchema({
},
}),
creatorID: UUIDType({
foreignKey: { schema: "Account", column: "ID" },
foreignKey: { schema: "Account", column: "id" },
}),
},
});
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/loaders/raw-count-loader.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const TodoSchema = new EntSchema({
},
}),
creatorID: UUIDType({
foreignKey: { schema: "Account", column: "ID" },
foreignKey: { schema: "Account", column: "id" },
}),
};
});
Expand Down
14 changes: 7 additions & 7 deletions examples/ent-rsvp/backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ent-rsvp/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"dependencies": {
"@sentry/node": "^6.3.0",
"@sentry/tracing": "^6.3.0",
"@snowtop/ent": "^0.2.0-alpha.1",
"@snowtop/ent": "^0.2.0-alpha.2",
"@snowtop/ent-email": "^0.1.0-rc1",
"@snowtop/ent-passport": "^0.1.0-rc1",
"@snowtop/ent-password": "^0.1.0-rc1",
Expand Down
16 changes: 8 additions & 8 deletions examples/ent-rsvp/backend/src/ent/generated/loaders.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/ent-rsvp/backend/src/schema/auth_code_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const AuthCodeSchema = new EntSchema({
fields: {
code: StringType(),
guestID: UUIDType({
foreignKey: { schema: "Guest", column: "ID" },
foreignKey: { schema: "Guest", column: "id" },
unique: true,
}),
emailAddress: EmailType(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const EventActivitySchema = new EntSchema({
fields: {
Name: StringType(),
eventID: UUIDType({
foreignKey: { schema: "Event", column: "ID" },
foreignKey: { schema: "Event", column: "id" },
}),
StartTime: TimestampType(),
EndTime: TimestampType({ nullable: true }),
Expand Down
2 changes: 1 addition & 1 deletion examples/ent-rsvp/backend/src/schema/event_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const EventSchema = new EntSchema({
// start nullable so as to not break existing objects
Slug: StringType({ nullable: true, unique: true }),
creatorID: UUIDType({
foreignKey: { schema: "User", column: "ID" },
foreignKey: { schema: "User", column: "id" },
defaultToViewerOnCreate: true,
}),
},
Expand Down
4 changes: 2 additions & 2 deletions examples/ent-rsvp/backend/src/schema/guest_data_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ const GuestDataSchema = new EntSchema({

fields: {
guestID: UUIDType({
foreignKey: { schema: "Guest", column: "ID" },
foreignKey: { schema: "Guest", column: "id" },
}),
eventID: UUIDType({
foreignKey: { schema: "Event", column: "ID" },
foreignKey: { schema: "Event", column: "id" },
}),
dietaryRestrictions: StringType(),
//really just exists for https://github.com/lolopinto/ent/issues/636
Expand Down
2 changes: 1 addition & 1 deletion examples/ent-rsvp/backend/src/schema/guest_group_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const GuestGroupSchema = new EntSchema({
fields: {
InvitationName: StringType(),
EventID: UUIDType({
foreignKey: { schema: "Event", column: "ID" },
foreignKey: { schema: "Event", column: "id" },
}),
tag: EnumType({
globalType: "GuestTag",
Expand Down
4 changes: 2 additions & 2 deletions examples/ent-rsvp/backend/src/schema/guest_schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ const GuestSchema = new EntSchema({
fields: {
Name: StringType(),
eventID: UUIDType({
foreignKey: { schema: "Event", column: "ID" },
foreignKey: { schema: "Event", column: "id" },
}),
EmailAddress: EmailType({ nullable: true }),
guestGroupID: UUIDType({
foreignKey: { schema: "GuestGroup", column: "ID" },
foreignKey: { schema: "GuestGroup", column: "id" },
}),
title: StringType({ nullable: true }),
// contrived example of a field edge of a node hidden from graphql
Expand Down
14 changes: 7 additions & 7 deletions examples/simple/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/simple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"tsconfig-paths": "^3.11.0"
},
"dependencies": {
"@snowtop/ent": "^0.2.0-alpha.1",
"@snowtop/ent": "^0.2.0-alpha.2",
"@snowtop/ent-email": "^0.1.0-rc1",
"@snowtop/ent-passport": "^0.1.0-rc1",
"@snowtop/ent-password": "^0.1.0-rc1",
Expand Down
Loading
Loading