parseReferentialActions parses ON DELETE and ON UPDATE actions
()
| 291 | |
| 292 | // parseReferentialActions parses ON DELETE and ON UPDATE actions |
| 293 | func (p *Parser) parseReferentialActions() (onDelete, onUpdate string) { |
| 294 | for p.isType(models.TokenTypeOn) { |
| 295 | p.advance() // Consume ON |
| 296 | |
| 297 | if p.isType(models.TokenTypeDelete) { |
| 298 | p.advance() // Consume DELETE |
| 299 | onDelete = p.parseReferentialAction() |
| 300 | } else if p.isType(models.TokenTypeUpdate) { |
| 301 | p.advance() // Consume UPDATE |
| 302 | onUpdate = p.parseReferentialAction() |
| 303 | } else { |
| 304 | break |
| 305 | } |
| 306 | } |
| 307 | return |
| 308 | } |
| 309 | |
| 310 | // parseReferentialAction parses a single referential action (CASCADE, SET NULL, etc.) |
| 311 | func (p *Parser) parseReferentialAction() string { |
no test coverage detected