title: How can "on delete restrict" be used in a model?
body: <p>I have figured out how to use "on delete cascade", but am unclear on how to do "on delete restrict" constraints. What I would like to achieve is to not be able to delete a parent that has a child or children records.</p>
  
  <pre><code>class User(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      name = db.Column(db.String)
      fullname = db.Column(db.String)
      password = db.Column(db.String)
  
      posts = db.relationship("Post", backref='user', cascade="all, delete, delete-orphan")
  
  class Post(db.Model):
      id = db.Column(db.Integer, primary_key=True)
      title = db.Column(db.String, nullable=False)
      description = db.Column(db.String, nullable=False)
      user_id = db.Column(db.Integer, db.ForeignKey('users.id', onupdate="CASCADE", ondelete="CASCADE"))
  
  CREATE TABLE posts (
      id INTEGER NOT NULL,
      title VARCHAR NOT NULL,
      description VARCHAR NOT NULL,
      user_id INTEGER,
      PRIMARY KEY (id),
      FOREIGN KEY(user_id) REFERENCES users (id) ON DELETE RESTRICT ON UPDATE CASCADE
  );
  
  CREATE TABLE users (
      id INTEGER NOT NULL,
      name VARCHAR,
      fullname VARCHAR,
      password VARCHAR,
      PRIMARY KEY (id)
  );
  </code></pre>
  
  <p>Replacing "delete" with "restrict" just allows me to delete the parents and retain the orphaned rows.</p>
  
  <p>How do I properly specify the "restrict" behavior?</p>