Skip to content

Commit

Permalink
deprecate Dynamo tables but preserve reference / instances for alread…
Browse files Browse the repository at this point in the history
…y-deployed instances
  • Loading branch information
brianfeister committed Jan 2, 2025
1 parent ccc0ed5 commit 240f6b5
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions stacks/StorageStack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,24 @@ import { StackContext, Table } from 'sst/constructs';

export function StorageStack({ stack }: StackContext) {
// 🚨 WARNING 🚨 Deprecated, do not use
// const eventRsvpsTable = new Table(stack, 'EventRsvps', {
// fields: {
// id: 'string',
// userId: 'string',
// eventId: 'string',
// eventSourceId: 'string',
// eventSourceType: 'string',
// status: 'string',
// createdAt: 'number',
// updatedAt: 'number',
// },
// primaryIndex: { partitionKey: 'eventId', sortKey: 'userId' },
// globalIndexes: {
// userIdGsi: { partitionKey: 'userId', sortKey: 'eventId' },
// },
// });
const eventRsvpsTable = new Table(stack, 'EventRsvps', {
fields: {
id: 'string',
userId: 'string',
eventId: 'string',
eventSourceId: 'string',
eventSourceType: 'string',
status: 'string',
createdAt: 'number',
updatedAt: 'number',
},
primaryIndex: { partitionKey: 'eventId', sortKey: 'userId' },
globalIndexes: {
userIdGsi: { partitionKey: 'userId', sortKey: 'eventId' },
},
});

// 🚨 WARNING 🚨 Deprecated, do not use
// const purchasesTable = new Table(stack, 'Purchases', {
// fields: {
// id: 'string',
Expand Down Expand Up @@ -72,19 +73,19 @@ export function StorageStack({ stack }: StackContext) {
});

// 🚨 WARNING 🚨 Deprecated, do not use
// const registrationsTable = new Table(stack, 'Registrations', {
// fields: {
// eventId: 'string',
// userId: 'string',
// responses: 'string', // this is an array, no type for arrays
// createdAt: 'number',
// updatedAt: 'number',
// },
// primaryIndex: { partitionKey: 'eventId', sortKey: 'userId' },
// globalIndexes: {
// userIdGsi: { partitionKey: 'userId', sortKey: 'eventId' },
// },
// });
const registrationsTable = new Table(stack, 'Registrations', {
fields: {
eventId: 'string',
userId: 'string',
responses: 'string', // this is an array, no type for arrays
createdAt: 'number',
updatedAt: 'number',
},
primaryIndex: { partitionKey: 'eventId', sortKey: 'userId' },
globalIndexes: {
userIdGsi: { partitionKey: 'userId', sortKey: 'eventId' },
},
});

const registrationFieldsTable = new Table(stack, 'RegistrationFields', {
fields: {
Expand Down

0 comments on commit 240f6b5

Please sign in to comment.