- MySQL Workbench
> alter table customer add createdDate DATETIME; > alter table customer add isDeleted INT; > update customer set createdDate = now() > update customer set isDeleted = 0
- error code 1175
- Preferences –> Click “SQL Editor” tab and uncheck “Safe Updates” check box –> Reconnect to Server
- Reference https://stackoverflow.com/questions/11448068/mysql-error-code-1175-during-update-in-mysql-workbench
- error code 1175
- Implement Delete customer information
- CustomerDelete Component
import React from 'react'; class CustmerDelete extends React.Component{ deleteCustomer(id){ //REST API const url = 'api/customers/' + id; fetch(url, { method: 'DELETE' }); this.props.stateRefresh(); } render(){ return( <button onClick={(e) => {this.deleteCustomer(this.props.id)}}>Delete</button> ) } } export default CustmerDelete;
- Add Customer Delete Module in the Node.js Express server
app.delete('/api/customers/:id', (req, res) => { let sql = 'UPDATE customer SET isDeleted = 1 WHERE id = ?'; let params = [req.param.id]; connection.query (sql, params, (err, rows, fields) => { res.send(rows); }) });