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