aws / aws-appsync-community

The AWS AppSync community
https://aws.amazon.com/appsync
Apache License 2.0
506 stars 32 forks source link

Need soft delete functionality if update soft delete: true in table1 then need to automatically updated in softDeleted: true in other table2,table3 #294

Closed pankajinfowind closed 9 months ago

pankajinfowind commented 1 year ago

I am still stuck on a senerio ,the senerio is that.

I have four table's with one-to-many relation. TableName:- Template, template_Column, SpreadSheet, SpreadSheetRow.

I want soft delete functionality in my project, for that I need to add extra parameter(soft_deleted:boolean) in all table's . With this if i update Table1 item with parameter soft_deleted:true , then i want that , with that particular Template_Id other table (soft_deleted)parameter also updated to true. Tables are connected with one-to-many relation.

`type SpreadSheetRows @model @auth(rules: [{allow: public}]) { id: ID! items: String userID: ID! @index(name: "byUser") templatesID: ID! @index(name: "byTemplates") spreadsheetID: ID! @index(name: "bySpreadSheet") }

type SpreadSheet @model @auth(rules: [{allow: public}]) { id: ID! spreadsheet_name: String templatesID: ID! @index(name: "byTemplates") userID: ID! @index(name: "byUser") SpreadSheetRows: [SpreadSheetRows] @hasMany(indexName: "bySpreadSheet", fields: ["id"]) }

type TemplateColumns @model @auth(rules: [{allow: public}]) { id: ID! column_Name: String column_Type: String templatesID: ID! @index(name: "byTemplates") }

type Templates @model @auth(rules: [{allow: public}]) { id: ID! template_name: String userID: ID! @index(name: "byUser") TemplateColumns: [TemplateColumns] @hasMany(indexName: "byTemplates", fields: ["id"]) SpreadSheets: [SpreadSheet] @hasMany(indexName: "byTemplates", fields: ["id"]) SpreadSheetRows: [SpreadSheetRows] @hasMany(indexName: "byTemplates", fields: ["id"]) }

type User @model @auth(rules: [{allow: public}]) { id: ID! name: String email: String Templates: [Templates] @hasMany(indexName: "byUser", fields: ["id"]) SpreadSheets: [SpreadSheet] @hasMany(indexName: "byUser", fields: ["id"]) SpreadSheetRows: [SpreadSheetRows] @hasMany(indexName: "byUser", fields: ["id"]) } `

onlybakam commented 9 months ago

Hello, this issue should be opened in the Amplify repo: https://github.com/aws-amplify/amplify-cli