Merge "Convert tabs to spaces in a couple of rst files"
This commit is contained in:
commit
fad07f1c8e
@ -189,30 +189,30 @@ The following rundowns are true for all constraints classes:
|
||||
|
||||
cons = PrimaryKeyConstraint('id', 'num', table=self.table)
|
||||
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
|
||||
# Drop the constraint
|
||||
cons.drop()
|
||||
# Drop the constraint
|
||||
cons.drop()
|
||||
|
||||
You can also pass in :class:`~sqlalchemy.schema.Column` objects (and table
|
||||
argument can be left out):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
cons = PrimaryKeyConstraint(col1, col2)
|
||||
cons = PrimaryKeyConstraint(col1, col2)
|
||||
|
||||
#. Some dialects support ``CASCADE`` option when dropping constraints:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
cons = PrimaryKeyConstraint(col1, col2)
|
||||
cons = PrimaryKeyConstraint(col1, col2)
|
||||
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
# Create the constraint
|
||||
cons.create()
|
||||
|
||||
# Drop the constraint
|
||||
cons.drop(cascade=True)
|
||||
# Drop the constraint
|
||||
cons.drop(cascade=True)
|
||||
|
||||
.. note::
|
||||
SQLAlchemy Migrate will try to guess the name of the constraints for
|
||||
|
@ -140,7 +140,7 @@ Our first change script will create a simple table
|
||||
|
||||
account = Table(
|
||||
'account', meta,
|
||||
Column('id', Integer, primary_key=True),
|
||||
Column('id', Integer, primary_key=True),
|
||||
Column('login', String(40)),
|
||||
Column('passwd', String(40)),
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user