/usr/share/doc/python-migrate/html/api.html is in python-migrate 0.7.2-1ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Module migrate.changeset – Schema changes — SQLAlchemy Migrate v0.7.2 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '',
VERSION: '0.7.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="SQLAlchemy Migrate v0.7.2 documentation" href="index.html" />
<link rel="next" title="0.7.2 (2011-11-01)" href="changelog.html" />
<link rel="prev" title="Glossary" href="glossary.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="changelog.html" title="0.7.2 (2011-11-01)"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="glossary.html" title="Glossary"
accesskey="P">previous</a> |</li>
<li><a href="index.html">SQLAlchemy Migrate v0.7.2 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-migrate-changeset-schema-changes">
<h1>Module <a class="reference internal" href="#module-migrate.changeset" title="migrate.changeset: Database changeset management"><tt class="xref py py-mod docutils literal"><span class="pre">migrate.changeset</span></tt></a> – Schema changes<a class="headerlink" href="#module-migrate-changeset-schema-changes" title="Permalink to this headline">¶</a></h1>
<div class="section" id="module-migrate.changeset">
<span id="module-migrate-changeset-schema-migration-api"></span><h2>Module <a class="reference internal" href="#module-migrate.changeset" title="migrate.changeset: Database changeset management"><tt class="xref py py-mod docutils literal"><span class="pre">migrate.changeset</span></tt></a> – Schema migration API<a class="headerlink" href="#module-migrate.changeset" title="Permalink to this headline">¶</a></h2>
<p>This module extends SQLAlchemy and provides additional DDL <a class="footnote-reference" href="#id2" id="id1">[1]</a>
support.</p>
<table class="docutils footnote" frame="void" id="id2" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>SQL Data Definition Language</td></tr>
</tbody>
</table>
</div>
<div class="section" id="module-migrate.changeset.ansisql">
<span id="module-ansisql-standard-sql-implementation"></span><h2>Module <a class="reference internal" href="#module-migrate.changeset.ansisql" title="migrate.changeset.ansisql: Standard SQL implementation for altering database schemas"><tt class="xref py py-mod docutils literal"><span class="pre">ansisql</span></tt></a> – Standard SQL implementation<a class="headerlink" href="#module-migrate.changeset.ansisql" title="Permalink to this headline">¶</a></h2>
<p>Extensions to SQLAlchemy for altering existing tables.</p>
<p>At the moment, this isn’t so much based off of ANSI as much as
things that just happen to work with multiple databases.</p>
<dl class="class">
<dt id="migrate.changeset.ansisql.ANSIColumnDropper">
<em class="property">class </em><tt class="descclassname">migrate.changeset.ansisql.</tt><tt class="descname">ANSIColumnDropper</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSIColumnDropper" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends ANSI SQL dropper for column dropping (<tt class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span>
<span class="pre">DROP</span> <span class="pre">COLUMN</span></tt>).</p>
<dl class="method">
<dt id="migrate.changeset.ansisql.ANSIColumnDropper.visit_column">
<tt class="descname">visit_column</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSIColumnDropper.visit_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop a column from its table.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>column</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.Column</span></tt>) – the column object</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.ansisql.ANSIColumnGenerator">
<em class="property">class </em><tt class="descclassname">migrate.changeset.ansisql.</tt><tt class="descname">ANSIColumnGenerator</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSIColumnGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>Extends ansisql generator for column creation (alter table add col)</p>
<dl class="method">
<dt id="migrate.changeset.ansisql.ANSIColumnGenerator.visit_column">
<tt class="descname">visit_column</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSIColumnGenerator.visit_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a column (table already exists).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>column</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.Column</span></tt> instance) – column object</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.ansisql.ANSIConstraintCommon">
<em class="property">class </em><tt class="descclassname">migrate.changeset.ansisql.</tt><tt class="descname">ANSIConstraintCommon</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSIConstraintCommon" title="Permalink to this definition">¶</a></dt>
<dd><p>Migrate’s constraints require a separate creation function from
SA’s: Migrate’s constraints are created independently of a table;
SA’s are created at the same time as the table.</p>
<dl class="method">
<dt id="migrate.changeset.ansisql.ANSIConstraintCommon.get_constraint_name">
<tt class="descname">get_constraint_name</tt><big>(</big><em>cons</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSIConstraintCommon.get_constraint_name" title="Permalink to this definition">¶</a></dt>
<dd><p>Gets a name for the given constraint.</p>
<p>If the name is already set it will be used otherwise the
constraint’s <tt class="xref py py-meth docutils literal"><span class="pre">autoname</span></tt>
method is used.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>cons</strong> – constraint object</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.ansisql.ANSISchemaChanger">
<em class="property">class </em><tt class="descclassname">migrate.changeset.ansisql.</tt><tt class="descname">ANSISchemaChanger</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSISchemaChanger" title="Permalink to this definition">¶</a></dt>
<dd><p>Manages changes to existing schema elements.</p>
<p>Note that columns are schema elements; <tt class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span> <span class="pre">ADD</span> <span class="pre">COLUMN</span></tt>
is in SchemaGenerator.</p>
<p>All items may be renamed. Columns can also have many of their properties -
type, for example - changed.</p>
<p>Each function is passed a tuple, containing (object, name); where
object is a type of object you’d expect for that function
(ie. table for visit_table) and name is the object’s new
name. NONE means the name is unchanged.</p>
<dl class="method">
<dt id="migrate.changeset.ansisql.ANSISchemaChanger.start_alter_column">
<tt class="descname">start_alter_column</tt><big>(</big><em>table</em>, <em>col_name</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSISchemaChanger.start_alter_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Starts ALTER COLUMN</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.ansisql.ANSISchemaChanger.visit_column">
<tt class="descname">visit_column</tt><big>(</big><em>delta</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSISchemaChanger.visit_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename/change a column.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.ansisql.ANSISchemaChanger.visit_index">
<tt class="descname">visit_index</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSISchemaChanger.visit_index" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename an index</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.ansisql.ANSISchemaChanger.visit_table">
<tt class="descname">visit_table</tt><big>(</big><em>table</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.ANSISchemaChanger.visit_table" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename a table. Other ops aren’t supported.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.ansisql.AlterTableVisitor">
<em class="property">class </em><tt class="descclassname">migrate.changeset.ansisql.</tt><tt class="descname">AlterTableVisitor</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.AlterTableVisitor" title="Permalink to this definition">¶</a></dt>
<dd><p>Common operations for <tt class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span></tt> statements.</p>
<dl class="method">
<dt id="migrate.changeset.ansisql.AlterTableVisitor.append">
<tt class="descname">append</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.AlterTableVisitor.append" title="Permalink to this definition">¶</a></dt>
<dd><p>Append content to the SchemaIterator’s query buffer.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.ansisql.AlterTableVisitor.execute">
<tt class="descname">execute</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.AlterTableVisitor.execute" title="Permalink to this definition">¶</a></dt>
<dd><p>Execute the contents of the SchemaIterator’s buffer.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.ansisql.AlterTableVisitor.start_alter_table">
<tt class="descname">start_alter_table</tt><big>(</big><em>param</em><big>)</big><a class="headerlink" href="#migrate.changeset.ansisql.AlterTableVisitor.start_alter_table" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the start of an <tt class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span></tt> SQL-Statement.</p>
<p>Use the param object to determine the table name and use it
for building the SQL statement.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>param</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.Column</span></tt>, <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.Index</span></tt>,
<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.schema.Constraint</span></tt>, <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.Table</span></tt>,
or string (table name)) – object to determine the table from</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-migrate.changeset.constraint">
<span id="module-constraint-constraint-schema-migration-api"></span><h2>Module <a class="reference internal" href="#module-migrate.changeset.constraint" title="migrate.changeset.constraint: Standalone schema constraint objects"><tt class="xref py py-mod docutils literal"><span class="pre">constraint</span></tt></a> – Constraint schema migration API<a class="headerlink" href="#module-migrate.changeset.constraint" title="Permalink to this headline">¶</a></h2>
<p>This module defines standalone schema constraint classes.</p>
<dl class="class">
<dt id="migrate.changeset.constraint.CheckConstraint">
<em class="property">class </em><tt class="descclassname">migrate.changeset.constraint.</tt><tt class="descname">CheckConstraint</tt><big>(</big><em>sqltext</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.CheckConstraint" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#migrate.changeset.constraint.ConstraintChangeset" title="migrate.changeset.constraint.ConstraintChangeset"><tt class="xref py py-class docutils literal"><span class="pre">migrate.changeset.constraint.ConstraintChangeset</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.schema.CheckConstraint</span></tt></p>
<p>Construct CheckConstraint</p>
<p>Migrate’s additional parameters:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>sqltext</strong> (<em>string</em>) – Plain SQL text to check condition</li>
<li><strong>columns</strong> (<em>list of Columns instances</em>) – If not name is applied, you must supply this kw to autoname constraint</li>
<li><strong>table</strong> (<em>Table instance</em>) – If columns are passed as strings, this kw is required</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="migrate.changeset.constraint.CheckConstraint.create">
<tt class="descname">create</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.CheckConstraint.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create the constraint in the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is <tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.CheckConstraint.drop">
<tt class="descname">drop</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.CheckConstraint.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop the constraint from the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is
<tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>cascade</strong> (<em>bool</em>) – Issue CASCADE drop if database supports it</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Instance with cleared columns</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.CheckConstraint.get_children">
<tt class="descname">get_children</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.CheckConstraint.get_children" title="Permalink to this definition">¶</a></dt>
<dd><p>used to allow SchemaVisitor access</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.constraint.ConstraintChangeset">
<em class="property">class </em><tt class="descclassname">migrate.changeset.constraint.</tt><tt class="descname">ConstraintChangeset</tt><a class="headerlink" href="#migrate.changeset.constraint.ConstraintChangeset" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">object</span></tt></p>
<p>Base class for Constraint classes.</p>
<dl class="method">
<dt id="migrate.changeset.constraint.ConstraintChangeset.create">
<tt class="descname">create</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.ConstraintChangeset.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create the constraint in the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is <tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.ConstraintChangeset.drop">
<tt class="descname">drop</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.ConstraintChangeset.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop the constraint from the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is
<tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>cascade</strong> (<em>bool</em>) – Issue CASCADE drop if database supports it</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Instance with cleared columns</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.constraint.ForeignKeyConstraint">
<em class="property">class </em><tt class="descclassname">migrate.changeset.constraint.</tt><tt class="descname">ForeignKeyConstraint</tt><big>(</big><em>columns</em>, <em>refcolumns</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.ForeignKeyConstraint" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#migrate.changeset.constraint.ConstraintChangeset" title="migrate.changeset.constraint.ConstraintChangeset"><tt class="xref py py-class docutils literal"><span class="pre">migrate.changeset.constraint.ConstraintChangeset</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.schema.ForeignKeyConstraint</span></tt></p>
<p>Construct ForeignKeyConstraint</p>
<p>Migrate’s additional parameters:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>columns</strong> (<em>list of strings or Column instances</em>) – Columns in constraint</li>
<li><strong>refcolumns</strong> (<em>list of strings or Column instances</em>) – Columns that this FK reffers to in another table.</li>
<li><strong>table</strong> (<em>Table instance</em>) – If columns are passed as strings, this kw is required</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="migrate.changeset.constraint.ForeignKeyConstraint.autoname">
<tt class="descname">autoname</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.ForeignKeyConstraint.autoname" title="Permalink to this definition">¶</a></dt>
<dd><p>Mimic the database’s automatic constraint names</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.ForeignKeyConstraint.create">
<tt class="descname">create</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.ForeignKeyConstraint.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create the constraint in the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is <tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.ForeignKeyConstraint.drop">
<tt class="descname">drop</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.ForeignKeyConstraint.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop the constraint from the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is
<tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>cascade</strong> (<em>bool</em>) – Issue CASCADE drop if database supports it</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Instance with cleared columns</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.ForeignKeyConstraint.get_children">
<tt class="descname">get_children</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.ForeignKeyConstraint.get_children" title="Permalink to this definition">¶</a></dt>
<dd><p>used to allow SchemaVisitor access</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.constraint.PrimaryKeyConstraint">
<em class="property">class </em><tt class="descclassname">migrate.changeset.constraint.</tt><tt class="descname">PrimaryKeyConstraint</tt><big>(</big><em>*cols</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.PrimaryKeyConstraint" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#migrate.changeset.constraint.ConstraintChangeset" title="migrate.changeset.constraint.ConstraintChangeset"><tt class="xref py py-class docutils literal"><span class="pre">migrate.changeset.constraint.ConstraintChangeset</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.schema.PrimaryKeyConstraint</span></tt></p>
<p>Construct PrimaryKeyConstraint</p>
<p>Migrate’s additional parameters:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>cols</strong> (<em>strings or Column instances</em>) – Columns in constraint.</li>
<li><strong>table</strong> (<em>Table instance</em>) – If columns are passed as strings, this kw is required</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="method">
<dt id="migrate.changeset.constraint.PrimaryKeyConstraint.autoname">
<tt class="descname">autoname</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.PrimaryKeyConstraint.autoname" title="Permalink to this definition">¶</a></dt>
<dd><p>Mimic the database’s automatic constraint names</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.PrimaryKeyConstraint.create">
<tt class="descname">create</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.PrimaryKeyConstraint.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create the constraint in the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is <tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.PrimaryKeyConstraint.drop">
<tt class="descname">drop</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.PrimaryKeyConstraint.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop the constraint from the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is
<tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>cascade</strong> (<em>bool</em>) – Issue CASCADE drop if database supports it</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Instance with cleared columns</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.PrimaryKeyConstraint.get_children">
<tt class="descname">get_children</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.PrimaryKeyConstraint.get_children" title="Permalink to this definition">¶</a></dt>
<dd><p>used to allow SchemaVisitor access</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.constraint.UniqueConstraint">
<em class="property">class </em><tt class="descclassname">migrate.changeset.constraint.</tt><tt class="descname">UniqueConstraint</tt><big>(</big><em>*cols</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.UniqueConstraint" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#migrate.changeset.constraint.ConstraintChangeset" title="migrate.changeset.constraint.ConstraintChangeset"><tt class="xref py py-class docutils literal"><span class="pre">migrate.changeset.constraint.ConstraintChangeset</span></tt></a>, <tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.schema.UniqueConstraint</span></tt></p>
<p>Construct UniqueConstraint</p>
<p>Migrate’s additional parameters:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>cols</strong> (<em>strings or Column instances</em>) – Columns in constraint.</li>
<li><strong>table</strong> (<em>Table instance</em>) – If columns are passed as strings, this kw is required</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p class="versionadded">
<span class="versionmodified">New in version 0.6.0.</span></p>
<dl class="method">
<dt id="migrate.changeset.constraint.UniqueConstraint.autoname">
<tt class="descname">autoname</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.UniqueConstraint.autoname" title="Permalink to this definition">¶</a></dt>
<dd><p>Mimic the database’s automatic constraint names</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.UniqueConstraint.create">
<tt class="descname">create</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.UniqueConstraint.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create the constraint in the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is <tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.UniqueConstraint.drop">
<tt class="descname">drop</tt><big>(</big><em>*a</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.UniqueConstraint.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop the constraint from the database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Engine</span></tt>) – the database engine to use. If this is
<tt class="xref std std-keyword xref docutils literal"><span class="pre">None</span></tt> the instance’s engine will be used</li>
<li><strong>cascade</strong> (<em>bool</em>) – Issue CASCADE drop if database supports it</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Instance with cleared columns</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.constraint.UniqueConstraint.get_children">
<tt class="descname">get_children</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.constraint.UniqueConstraint.get_children" title="Permalink to this definition">¶</a></dt>
<dd><p>used to allow SchemaVisitor access</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-migrate.changeset.databases">
<span id="module-databases-database-specific-schema-migration"></span><h2>Module <a class="reference internal" href="#module-migrate.changeset.databases" title="migrate.changeset.databases: Database specific changeset implementations"><tt class="xref py py-mod docutils literal"><span class="pre">databases</span></tt></a> – Database specific schema migration<a class="headerlink" href="#module-migrate.changeset.databases" title="Permalink to this headline">¶</a></h2>
<p>This module contains database dialect specific changeset
implementations.</p>
<div class="section" id="module-migrate.changeset.databases.mysql">
<span id="module-mysql"></span><span id="mysql-d"></span><h3>Module <a class="reference internal" href="#module-migrate.changeset.databases.mysql" title="migrate.changeset.databases.mysql: MySQL database specific changeset implementations"><tt class="xref py py-mod docutils literal"><span class="pre">mysql</span></tt></a><a class="headerlink" href="#module-migrate.changeset.databases.mysql" title="Permalink to this headline">¶</a></h3>
<p>MySQL database specific implementations of changeset classes.</p>
</div>
<div class="section" id="module-migrate.changeset.databases.firebird">
<span id="module-firebird"></span><span id="firebird-d"></span><h3>Module <a class="reference internal" href="#module-migrate.changeset.databases.firebird" title="migrate.changeset.databases.firebird: Firebird database specific changeset implementations"><tt class="xref py py-mod docutils literal"><span class="pre">firebird</span></tt></a><a class="headerlink" href="#module-migrate.changeset.databases.firebird" title="Permalink to this headline">¶</a></h3>
<p>Firebird database specific implementations of changeset classes.</p>
<dl class="class">
<dt id="migrate.changeset.databases.firebird.FBColumnDropper">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.firebird.</tt><tt class="descname">FBColumnDropper</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.firebird.FBColumnDropper" title="Permalink to this definition">¶</a></dt>
<dd><p>Firebird column dropper implementation.</p>
<dl class="method">
<dt id="migrate.changeset.databases.firebird.FBColumnDropper.visit_column">
<tt class="descname">visit_column</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.firebird.FBColumnDropper.visit_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Firebird supports ‘DROP col’ instead of ‘DROP COLUMN col’ syntax</p>
<p>Drop primary key and unique constraints if dropped column is referencing it.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.firebird.FBColumnGenerator">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.firebird.</tt><tt class="descname">FBColumnGenerator</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.firebird.FBColumnGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>Firebird column generator implementation.</p>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.firebird.FBConstraintDropper">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.firebird.</tt><tt class="descname">FBConstraintDropper</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.firebird.FBConstraintDropper" title="Permalink to this definition">¶</a></dt>
<dd><p>Firebird constaint dropper implementation.</p>
<dl class="method">
<dt id="migrate.changeset.databases.firebird.FBConstraintDropper.cascade_constraint">
<tt class="descname">cascade_constraint</tt><big>(</big><em>constraint</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.firebird.FBConstraintDropper.cascade_constraint" title="Permalink to this definition">¶</a></dt>
<dd><p>Cascading constraints is not supported</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.firebird.FBConstraintGenerator">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.firebird.</tt><tt class="descname">FBConstraintGenerator</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.firebird.FBConstraintGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>Firebird constraint generator implementation.</p>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.firebird.FBSchemaChanger">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.firebird.</tt><tt class="descname">FBSchemaChanger</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.firebird.FBSchemaChanger" title="Permalink to this definition">¶</a></dt>
<dd><p>Firebird schema changer implementation.</p>
<dl class="method">
<dt id="migrate.changeset.databases.firebird.FBSchemaChanger.visit_table">
<tt class="descname">visit_table</tt><big>(</big><em>table</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.firebird.FBSchemaChanger.visit_table" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename table not supported</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-migrate.changeset.databases.oracle">
<span id="module-oracle"></span><span id="oracle-d"></span><h3>Module <a class="reference internal" href="#module-migrate.changeset.databases.oracle" title="migrate.changeset.databases.oracle: Oracle database specific changeset implementations"><tt class="xref py py-mod docutils literal"><span class="pre">oracle</span></tt></a><a class="headerlink" href="#module-migrate.changeset.databases.oracle" title="Permalink to this headline">¶</a></h3>
<p>Oracle database specific implementations of changeset classes.</p>
</div>
<div class="section" id="module-migrate.changeset.databases.postgres">
<span id="module-postgres"></span><span id="postgres-d"></span><h3>Module <a class="reference internal" href="#module-migrate.changeset.databases.postgres" title="migrate.changeset.databases.postgres: PostgreSQL database specific changeset implementations"><tt class="xref py py-mod docutils literal"><span class="pre">postgres</span></tt></a><a class="headerlink" href="#module-migrate.changeset.databases.postgres" title="Permalink to this headline">¶</a></h3>
<p><a class="reference external" href="http://www.postgresql.org/">PostgreSQL</a> database specific implementations of changeset classes.</p>
<dl class="class">
<dt id="migrate.changeset.databases.postgres.PGColumnDropper">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.postgres.</tt><tt class="descname">PGColumnDropper</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.postgres.PGColumnDropper" title="Permalink to this definition">¶</a></dt>
<dd><p>PostgreSQL column dropper implementation.</p>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.postgres.PGColumnGenerator">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.postgres.</tt><tt class="descname">PGColumnGenerator</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.postgres.PGColumnGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>PostgreSQL column generator implementation.</p>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.postgres.PGConstraintDropper">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.postgres.</tt><tt class="descname">PGConstraintDropper</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.postgres.PGConstraintDropper" title="Permalink to this definition">¶</a></dt>
<dd><p>PostgreSQL constaint dropper implementation.</p>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.postgres.PGConstraintGenerator">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.postgres.</tt><tt class="descname">PGConstraintGenerator</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.postgres.PGConstraintGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>PostgreSQL constraint generator implementation.</p>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.postgres.PGSchemaChanger">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.postgres.</tt><tt class="descname">PGSchemaChanger</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.postgres.PGSchemaChanger" title="Permalink to this definition">¶</a></dt>
<dd><p>PostgreSQL schema changer implementation.</p>
</dd></dl>
</div>
<div class="section" id="module-migrate.changeset.databases.sqlite">
<span id="module-sqlite"></span><span id="sqlite-d"></span><h3>Module <a class="reference internal" href="#module-migrate.changeset.databases.sqlite" title="migrate.changeset.databases.sqlite: SQLite database specific changeset implementations"><tt class="xref py py-mod docutils literal"><span class="pre">sqlite</span></tt></a><a class="headerlink" href="#module-migrate.changeset.databases.sqlite" title="Permalink to this headline">¶</a></h3>
<p><a class="reference external" href="http://www.sqlite.org/">SQLite</a> database specific implementations of changeset classes.</p>
<dl class="class">
<dt id="migrate.changeset.databases.sqlite.SQLiteColumnDropper">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.sqlite.</tt><tt class="descname">SQLiteColumnDropper</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.sqlite.SQLiteColumnDropper" title="Permalink to this definition">¶</a></dt>
<dd><p>SQLite ColumnDropper</p>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.sqlite.SQLiteColumnGenerator">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.sqlite.</tt><tt class="descname">SQLiteColumnGenerator</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.sqlite.SQLiteColumnGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>SQLite ColumnGenerator</p>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.databases.sqlite.SQLiteSchemaChanger">
<em class="property">class </em><tt class="descclassname">migrate.changeset.databases.sqlite.</tt><tt class="descname">SQLiteSchemaChanger</tt><big>(</big><em>dialect</em>, <em>connection</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.sqlite.SQLiteSchemaChanger" title="Permalink to this definition">¶</a></dt>
<dd><p>SQLite SchemaChanger</p>
<dl class="method">
<dt id="migrate.changeset.databases.sqlite.SQLiteSchemaChanger.visit_index">
<tt class="descname">visit_index</tt><big>(</big><em>index</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.sqlite.SQLiteSchemaChanger.visit_index" title="Permalink to this definition">¶</a></dt>
<dd><p>Does not support ALTER INDEX</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-migrate.changeset.databases.visitor">
<span id="module-visitor"></span><h3>Module <a class="reference internal" href="#module-migrate.changeset.databases.visitor" title="migrate.changeset.databases.visitor"><tt class="xref py py-mod docutils literal"><span class="pre">visitor</span></tt></a><a class="headerlink" href="#module-migrate.changeset.databases.visitor" title="Permalink to this headline">¶</a></h3>
<p>Module for visitor class mapping.</p>
<dl class="function">
<dt id="migrate.changeset.databases.visitor.get_dialect_visitor">
<tt class="descclassname">migrate.changeset.databases.visitor.</tt><tt class="descname">get_dialect_visitor</tt><big>(</big><em>sa_dialect</em>, <em>name</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.visitor.get_dialect_visitor" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the visitor implementation for the given dialect.</p>
<p>Finds the visitor implementation based on the dialect class and
returns and instance initialized with the given name.</p>
<p>Binds dialect specific preparer to visitor.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.changeset.databases.visitor.get_engine_visitor">
<tt class="descclassname">migrate.changeset.databases.visitor.</tt><tt class="descname">get_engine_visitor</tt><big>(</big><em>engine</em>, <em>name</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.visitor.get_engine_visitor" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the visitor implementation for the given database engine.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>engine</strong> (<em>Engine</em>) – SQLAlchemy Engine</li>
<li><strong>name</strong> (<em>string</em>) – Name of the visitor</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">visitor</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="migrate.changeset.databases.visitor.run_single_visitor">
<tt class="descclassname">migrate.changeset.databases.visitor.</tt><tt class="descname">run_single_visitor</tt><big>(</big><em>engine</em>, <em>visitorcallable</em>, <em>element</em>, <em>connection=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.databases.visitor.run_single_visitor" title="Permalink to this definition">¶</a></dt>
<dd><p>Taken from <tt class="xref py py-meth docutils literal"><span class="pre">sqlalchemy.engine.base.Engine._run_single_visitor()</span></tt>
with support for migrate visitors.</p>
</dd></dl>
</div>
</div>
<div class="section" id="module-migrate.changeset.schema">
<span id="module-schema-additional-api-to-sqlalchemy-for-migrations"></span><h2>Module <a class="reference internal" href="#module-migrate.changeset.schema" title="migrate.changeset.schema: Schema changeset handling functions"><tt class="xref py py-mod docutils literal"><span class="pre">schema</span></tt></a> – Additional API to SQLAlchemy for migrations<a class="headerlink" href="#module-migrate.changeset.schema" title="Permalink to this headline">¶</a></h2>
<p>Schema module providing common schema operations.</p>
<dl class="function">
<dt id="migrate.changeset.schema.create_column">
<tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">create_column</tt><big>(</big><em>column</em>, <em>table=None</em>, <em>*p</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.create_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a column, given the table.</p>
<p>API to <a class="reference internal" href="#migrate.changeset.schema.ChangesetColumn.create" title="migrate.changeset.schema.ChangesetColumn.create"><tt class="xref py py-meth docutils literal"><span class="pre">ChangesetColumn.create()</span></tt></a>.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.changeset.schema.drop_column">
<tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">drop_column</tt><big>(</big><em>column</em>, <em>table=None</em>, <em>*p</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.drop_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop a column, given the table.</p>
<p>API to <a class="reference internal" href="#migrate.changeset.schema.ChangesetColumn.drop" title="migrate.changeset.schema.ChangesetColumn.drop"><tt class="xref py py-meth docutils literal"><span class="pre">ChangesetColumn.drop()</span></tt></a>.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.changeset.schema.alter_column">
<tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">alter_column</tt><big>(</big><em>*p</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.alter_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Alter a column.</p>
<p>This is a helper function that creates a <a class="reference internal" href="#migrate.changeset.schema.ColumnDelta" title="migrate.changeset.schema.ColumnDelta"><tt class="xref py py-class docutils literal"><span class="pre">ColumnDelta</span></tt></a> and
runs it.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>column</strong> – The name of the column to be altered or a
<a class="reference internal" href="#migrate.changeset.schema.ChangesetColumn" title="migrate.changeset.schema.ChangesetColumn"><tt class="xref py py-class docutils literal"><span class="pre">ChangesetColumn</span></tt></a> column representing it.</li>
<li><strong>table</strong> – A <tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt> or table name to
for the table where the column will be changed.</li>
<li><strong>engine</strong> – The <tt class="xref py py-class docutils literal"><span class="pre">Engine</span></tt> to use for table
reflection and schema alterations.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A <a class="reference internal" href="#migrate.changeset.schema.ColumnDelta" title="migrate.changeset.schema.ColumnDelta"><tt class="xref py py-class docutils literal"><span class="pre">ColumnDelta</span></tt></a> instance representing the change.</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="migrate.changeset.schema.rename_table">
<tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">rename_table</tt><big>(</big><em>table</em>, <em>name</em>, <em>engine=None</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.rename_table" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename a table.</p>
<p>If Table instance is given, engine is not used.</p>
<p>API to <a class="reference internal" href="#migrate.changeset.schema.ChangesetTable.rename" title="migrate.changeset.schema.ChangesetTable.rename"><tt class="xref py py-meth docutils literal"><span class="pre">ChangesetTable.rename()</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>table</strong> (<em>string or Table instance</em>) – Table to be renamed.</li>
<li><strong>name</strong> (<em>string</em>) – New name for Table.</li>
<li><strong>engine</strong> (<em>obj</em>) – Engine instance.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="migrate.changeset.schema.rename_index">
<tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">rename_index</tt><big>(</big><em>index</em>, <em>name</em>, <em>table=None</em>, <em>engine=None</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.rename_index" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename an index.</p>
<p>If Index instance is given,
table and engine are not used.</p>
<p>API to <a class="reference internal" href="#migrate.changeset.schema.ChangesetIndex.rename" title="migrate.changeset.schema.ChangesetIndex.rename"><tt class="xref py py-meth docutils literal"><span class="pre">ChangesetIndex.rename()</span></tt></a>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>index</strong> (<em>string or Index instance</em>) – Index to be renamed.</li>
<li><strong>name</strong> (<em>string</em>) – New name for index.</li>
<li><strong>table</strong> (<em>string or Table instance</em>) – Table to which Index is reffered.</li>
<li><strong>engine</strong> (<em>obj</em>) – Engine instance.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.schema.ChangesetTable">
<em class="property">class </em><tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">ChangesetTable</tt><a class="headerlink" href="#migrate.changeset.schema.ChangesetTable" title="Permalink to this definition">¶</a></dt>
<dd><p>Changeset extensions to SQLAlchemy tables.</p>
<dl class="method">
<dt id="migrate.changeset.schema.ChangesetTable.create_column">
<tt class="descname">create_column</tt><big>(</big><em>column</em>, <em>*p</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ChangesetTable.create_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Creates a column.</p>
<p>The column parameter may be a column definition or the name of
a column in this table.</p>
<p>API to <a class="reference internal" href="#migrate.changeset.schema.ChangesetColumn.create" title="migrate.changeset.schema.ChangesetColumn.create"><tt class="xref py py-meth docutils literal"><span class="pre">ChangesetColumn.create()</span></tt></a></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>column</strong> (<em>Column instance or string</em>) – Column to be created</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ChangesetTable.deregister">
<tt class="descname">deregister</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ChangesetTable.deregister" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove this table from its metadata</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ChangesetTable.drop_column">
<tt class="descname">drop_column</tt><big>(</big><em>column</em>, <em>*p</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ChangesetTable.drop_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop a column, given its name or definition.</p>
<p>API to <a class="reference internal" href="#migrate.changeset.schema.ChangesetColumn.drop" title="migrate.changeset.schema.ChangesetColumn.drop"><tt class="xref py py-meth docutils literal"><span class="pre">ChangesetColumn.drop()</span></tt></a></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>column</strong> (<em>Column instance or string</em>) – Column to be droped</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ChangesetTable.rename">
<tt class="descname">rename</tt><big>(</big><em>name</em>, <em>connection=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ChangesetTable.rename" title="Permalink to this definition">¶</a></dt>
<dd><p>Rename this table.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<em>string</em>) – New name of the table.</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.schema.ChangesetColumn">
<em class="property">class </em><tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">ChangesetColumn</tt><a class="headerlink" href="#migrate.changeset.schema.ChangesetColumn" title="Permalink to this definition">¶</a></dt>
<dd><p>Changeset extensions to SQLAlchemy columns.</p>
<dl class="method">
<dt id="migrate.changeset.schema.ChangesetColumn.alter">
<tt class="descname">alter</tt><big>(</big><em>*p</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ChangesetColumn.alter" title="Permalink to this definition">¶</a></dt>
<dd><p>Makes a call to <a class="reference internal" href="#migrate.changeset.schema.alter_column" title="migrate.changeset.schema.alter_column"><tt class="xref py py-func docutils literal"><span class="pre">alter_column()</span></tt></a> for the column this
method is called on.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ChangesetColumn.copy_fixed">
<tt class="descname">copy_fixed</tt><big>(</big><em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ChangesetColumn.copy_fixed" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a copy of this <tt class="docutils literal"><span class="pre">Column</span></tt>, with all attributes.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ChangesetColumn.create">
<tt class="descname">create</tt><big>(</big><em>table=None</em>, <em>index_name=None</em>, <em>unique_name=None</em>, <em>primary_key_name=None</em>, <em>populate_default=True</em>, <em>connection=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ChangesetColumn.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create this column in the database.</p>
<p>Assumes the given table exists. <tt class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span> <span class="pre">ADD</span> <span class="pre">COLUMN</span></tt>,
for most databases.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>table</strong> (<em>Table instance</em>) – Table instance to create on.</li>
<li><strong>index_name</strong> (<em>string</em>) – Creates <a class="reference internal" href="#migrate.changeset.schema.ChangesetIndex" title="migrate.changeset.schema.ChangesetIndex"><tt class="xref py py-class docutils literal"><span class="pre">ChangesetIndex</span></tt></a> on this column.</li>
<li><strong>unique_name</strong> (<em>string</em>) – Creates <a class="reference internal" href="#migrate.changeset.constraint.UniqueConstraint" title="migrate.changeset.constraint.UniqueConstraint"><tt class="xref py py-class docutils literal"><span class="pre">UniqueConstraint</span></tt></a> on this column.</li>
<li><strong>primary_key_name</strong> (<em>string</em>) – Creates <a class="reference internal" href="#migrate.changeset.constraint.PrimaryKeyConstraint" title="migrate.changeset.constraint.PrimaryKeyConstraint"><tt class="xref py py-class docutils literal"><span class="pre">PrimaryKeyConstraint</span></tt></a> on this column.</li>
<li><strong>populate_default</strong> (<em>bool</em>) – If True, created column will be populated with defaults</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">self</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ChangesetColumn.drop">
<tt class="descname">drop</tt><big>(</big><em>table=None</em>, <em>connection=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ChangesetColumn.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Drop this column from the database, leaving its table intact.</p>
<p><tt class="docutils literal"><span class="pre">ALTER</span> <span class="pre">TABLE</span> <span class="pre">DROP</span> <span class="pre">COLUMN</span></tt>, for most databases.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.schema.ChangesetIndex">
<em class="property">class </em><tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">ChangesetIndex</tt><a class="headerlink" href="#migrate.changeset.schema.ChangesetIndex" title="Permalink to this definition">¶</a></dt>
<dd><p>Changeset extensions to SQLAlchemy Indexes.</p>
<dl class="method">
<dt id="migrate.changeset.schema.ChangesetIndex.rename">
<tt class="descname">rename</tt><big>(</big><em>name</em>, <em>connection=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ChangesetIndex.rename" title="Permalink to this definition">¶</a></dt>
<dd><p>Change the name of an index.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>name</strong> (<em>string</em>) – New name of the Index.</li>
<li><strong>connection</strong> (<tt class="xref py py-class docutils literal"><span class="pre">sqlalchemy.engine.base.Connection</span></tt> instance) – reuse connection istead of creating new one.</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.schema.ChangesetDefaultClause">
<em class="property">class </em><tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">ChangesetDefaultClause</tt><a class="headerlink" href="#migrate.changeset.schema.ChangesetDefaultClause" title="Permalink to this definition">¶</a></dt>
<dd><p>Implements comparison between <tt class="xref py py-class docutils literal"><span class="pre">DefaultClause</span></tt> instances</p>
</dd></dl>
<dl class="class">
<dt id="migrate.changeset.schema.ColumnDelta">
<em class="property">class </em><tt class="descclassname">migrate.changeset.schema.</tt><tt class="descname">ColumnDelta</tt><big>(</big><em>*p</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ColumnDelta" title="Permalink to this definition">¶</a></dt>
<dd><p>Extracts the differences between two columns/column-parameters</p>
<p>May receive parameters arranged in several different ways:</p>
<ul>
<li><dl class="first docutils">
<dt><strong>current_column, new_column, *p, **kw</strong></dt>
<dd><p class="first last">Additional parameters can be specified to override column
differences.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><strong>current_column, *p, **kw</strong></dt>
<dd><p class="first last">Additional parameters alter current_column. Table name is extracted
from current_column object.
Name is changed to current_column.name from current_name,
if current_name is specified.</p>
</dd>
</dl>
</li>
<li><dl class="first docutils">
<dt><strong>current_col_name, *p, **kw</strong></dt>
<dd><p class="first last">Table kw must specified.</p>
</dd>
</dl>
</li>
</ul>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>table</strong> (<em>string or Table instance</em>) – Table at which current Column should be bound to. If table name is given, reflection will be used.</li>
<li><strong>metadata</strong> – A <tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt> instance to store
reflected table names</li>
<li><strong>engine</strong> (<tt class="xref py py-class docutils literal"><span class="pre">Engine</span></tt> instance) – When reflecting tables, either engine or metadata must be specified to acquire engine object.</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><a class="reference internal" href="#migrate.changeset.schema.ColumnDelta" title="migrate.changeset.schema.ColumnDelta"><tt class="xref py py-class docutils literal"><span class="pre">ColumnDelta</span></tt></a> instance provides interface for altered attributes to <cite>result_column</cite> through <tt class="xref py py-func docutils literal"><span class="pre">dict()</span></tt> alike object.</p>
</td>
</tr>
</tbody>
</table>
<ul class="simple">
<li><a class="reference internal" href="#migrate.changeset.schema.ColumnDelta" title="migrate.changeset.schema.ColumnDelta"><tt class="xref py py-class docutils literal"><span class="pre">ColumnDelta</span></tt></a>.result_column is altered column with new attributes</li>
<li><a class="reference internal" href="#migrate.changeset.schema.ColumnDelta" title="migrate.changeset.schema.ColumnDelta"><tt class="xref py py-class docutils literal"><span class="pre">ColumnDelta</span></tt></a>.current_name is current name of column in db</li>
</ul>
<dl class="method">
<dt id="migrate.changeset.schema.ColumnDelta.apply_diffs">
<tt class="descname">apply_diffs</tt><big>(</big><em>diffs</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ColumnDelta.apply_diffs" title="Permalink to this definition">¶</a></dt>
<dd><p>Populate dict and column object with new values</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ColumnDelta.are_column_types_eq">
<tt class="descname">are_column_types_eq</tt><big>(</big><em>old_type</em>, <em>new_type</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ColumnDelta.are_column_types_eq" title="Permalink to this definition">¶</a></dt>
<dd><p>Compares two types to be equal</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ColumnDelta.compare_1_column">
<tt class="descname">compare_1_column</tt><big>(</big><em>col</em>, <em>*p</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ColumnDelta.compare_1_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Compares one Column object</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ColumnDelta.compare_2_columns">
<tt class="descname">compare_2_columns</tt><big>(</big><em>old_col</em>, <em>new_col</em>, <em>*p</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ColumnDelta.compare_2_columns" title="Permalink to this definition">¶</a></dt>
<dd><p>Compares two Column objects</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ColumnDelta.compare_parameters">
<tt class="descname">compare_parameters</tt><big>(</big><em>current_name</em>, <em>*p</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ColumnDelta.compare_parameters" title="Permalink to this definition">¶</a></dt>
<dd><p>Compares Column objects with reflection</p>
</dd></dl>
<dl class="method">
<dt id="migrate.changeset.schema.ColumnDelta.process_column">
<tt class="descname">process_column</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#migrate.changeset.schema.ColumnDelta.process_column" title="Permalink to this definition">¶</a></dt>
<dd><p>Processes default values for column</p>
</dd></dl>
</dd></dl>
</div>
</div>
<div class="section" id="module-migrate.versioning">
<span id="module-migrate-versioning-database-versioning-and-repository-management"></span><h1>Module <a class="reference internal" href="#module-migrate.versioning" title="migrate.versioning: Database version and repository management"><tt class="xref py py-mod docutils literal"><span class="pre">migrate.versioning</span></tt></a> – Database versioning and repository management<a class="headerlink" href="#module-migrate.versioning" title="Permalink to this headline">¶</a></h1>
<p>This package provides functionality to create and manage
repositories of database schema changesets and to apply these
changesets to databases.</p>
<div class="section" id="module-migrate.versioning.api">
<span id="module-api-python-api-commands"></span><span id="versioning-api"></span><h2>Module <a class="reference internal" href="#module-migrate.versioning.api" title="migrate.versioning.api: External API for :mod:`migrate.versioning`"><tt class="xref py py-mod docutils literal"><span class="pre">api</span></tt></a> – Python API commands<a class="headerlink" href="#module-migrate.versioning.api" title="Permalink to this headline">¶</a></h2>
<p>This module provides an external API to the versioning system.</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.6.0: </span><a class="reference internal" href="#migrate.versioning.api.test" title="migrate.versioning.api.test"><tt class="xref py py-func docutils literal"><span class="pre">migrate.versioning.api.test()</span></tt></a> and schema diff functions
changed order of positional arguments so all accept <cite>url</cite> and <cite>repository</cite>
as first arguments.</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.5.4: </span><tt class="docutils literal"><span class="pre">--preview_sql</span></tt> displays source file when using SQL scripts.
If Python script is used, it runs the action with mocked engine and
returns captured SQL statements.</p>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.5.4: </span>Deprecated <tt class="docutils literal"><span class="pre">--echo</span></tt> parameter in favour of new
<a class="reference internal" href="#migrate.versioning.util.construct_engine" title="migrate.versioning.util.construct_engine"><tt class="xref py py-func docutils literal"><span class="pre">migrate.versioning.util.construct_engine()</span></tt></a> behavior.</p>
<dl class="function">
<dt id="migrate.versioning.api.db_version">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">db_version</tt><big>(</big><em>url</em>, <em>repository</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.db_version" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog db_version URL REPOSITORY_PATH</p>
<p>Show the current version of the repository with the given
connection string, under version control of the specified
repository.</p>
<p>The url should be any valid SQLAlchemy connection string.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.upgrade">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">upgrade</tt><big>(</big><em>url</em>, <em>repository</em>, <em>version=None</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.upgrade" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog upgrade URL REPOSITORY_PATH [VERSION] [–preview_py|–preview_sql]</p>
<p>Upgrade a database to a later version.</p>
<p>This runs the upgrade() function defined in your change scripts.</p>
<p>By default, the database is updated to the latest available
version. You may specify a version instead, if you wish.</p>
<p>You may preview the Python or SQL code to be executed, rather than
actually executing it, using the appropriate ‘preview’ option.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.drop_version_control">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">drop_version_control</tt><big>(</big><em>url</em>, <em>repository</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.drop_version_control" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog drop_version_control URL REPOSITORY_PATH</p>
<p>Removes version control from a database.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.help">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">help</tt><big>(</big><em>cmd=None</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.help" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog help COMMAND</p>
<p>Displays help on a given command.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.script">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">script</tt><big>(</big><em>description</em>, <em>repository</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.script" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog script DESCRIPTION REPOSITORY_PATH</p>
<p>Create an empty change script using the next unused version number
appended with the given description.</p>
<p>For instance, manage.py script “Add initial tables” creates:
repository/versions/001_Add_initial_tables.py</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.test">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">test</tt><big>(</big><em>url</em>, <em>repository</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.test" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog test URL REPOSITORY_PATH [VERSION]</p>
<p>Performs the upgrade and downgrade option on the given
database. This is not a real test and may leave the database in a
bad state. You should therefore better run the test on a copy of
your database.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.create">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">create</tt><big>(</big><em>repository</em>, <em>name</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.create" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog create REPOSITORY_PATH NAME [–table=TABLE]</p>
<p>Create an empty repository at the specified path.</p>
<p>You can specify the version_table to be used; by default, it is
‘migrate_version’. This table is created in all version-controlled
databases.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.manage">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">manage</tt><big>(</big><em>file</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.manage" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog manage FILENAME [VARIABLES...]</p>
<p>Creates a script that runs Migrate with a set of default values.</p>
<p>For example:</p>
<div class="highlight-python"><pre>%prog manage manage.py --repository=/path/to/repository --url=sqlite:///project.db</pre>
</div>
<p>would create the script manage.py. The following two commands
would then have exactly the same results:</p>
<div class="highlight-python"><pre>python manage.py version
%prog version --repository=/path/to/repository</pre>
</div>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.update_db_from_model">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">update_db_from_model</tt><big>(</big><em>url</em>, <em>repository</em>, <em>model</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.update_db_from_model" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog update_db_from_model URL REPOSITORY_PATH MODEL</p>
<p>Modify the database to match the structure of the current Python
model. This also sets the db_version number to the latest in the
repository.</p>
<p>NOTE: This is EXPERIMENTAL.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.create_model">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">create_model</tt><big>(</big><em>url</em>, <em>repository</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.create_model" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog create_model URL REPOSITORY_PATH [DECLERATIVE=True]</p>
<p>Dump the current database as a Python model to stdout.</p>
<p>NOTE: This is EXPERIMENTAL.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.source">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">source</tt><big>(</big><em>version</em>, <em>dest=None</em>, <em>repository=None</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.source" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog source VERSION [DESTINATION] –repository=REPOSITORY_PATH</p>
<p>Display the Python code for a particular version in this
repository. Save it to the file at DESTINATION or, if omitted,
send to stdout.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.version">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">version</tt><big>(</big><em>repository</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.version" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog version REPOSITORY_PATH</p>
<p>Display the latest version available in a repository.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.make_update_script_for_model">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">make_update_script_for_model</tt><big>(</big><em>url</em>, <em>repository</em>, <em>oldmodel</em>, <em>model</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.make_update_script_for_model" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog make_update_script_for_model URL OLDMODEL MODEL REPOSITORY_PATH</p>
<p>Create a script changing the old Python model to the new (current)
Python model, sending to stdout.</p>
<p>NOTE: This is EXPERIMENTAL.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.compare_model_to_db">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">compare_model_to_db</tt><big>(</big><em>url</em>, <em>repository</em>, <em>model</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.compare_model_to_db" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog compare_model_to_db URL REPOSITORY_PATH MODEL</p>
<p>Compare the current model (assumed to be a module level variable
of type sqlalchemy.MetaData) against the current database.</p>
<p>NOTE: This is EXPERIMENTAL.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.downgrade">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">downgrade</tt><big>(</big><em>url</em>, <em>repository</em>, <em>version</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.downgrade" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog downgrade URL REPOSITORY_PATH VERSION [–preview_py|–preview_sql]</p>
<p>Downgrade a database to an earlier version.</p>
<p>This is the reverse of upgrade; this runs the downgrade() function
defined in your change scripts.</p>
<p>You may preview the Python or SQL code to be executed, rather than
actually executing it, using the appropriate ‘preview’ option.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.version_control">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">version_control</tt><big>(</big><em>url</em>, <em>repository</em>, <em>version=None</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.version_control" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog version_control URL REPOSITORY_PATH [VERSION]</p>
<p>Mark a database as under this repository’s version control.</p>
<p>Once a database is under version control, schema changes should
only be done via change scripts in this repository.</p>
<p>This creates the table version_table in the database.</p>
<p>The url should be any valid SQLAlchemy connection string.</p>
<p>By default, the database begins at version 0 and is assumed to be
empty. If the database is not empty, you may specify a version at
which to begin instead. No attempt is made to verify this
version’s correctness - the database schema is expected to be
identical to what it would be if the database were created from
scratch.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.api.script_sql">
<tt class="descclassname">migrate.versioning.api.</tt><tt class="descname">script_sql</tt><big>(</big><em>database</em>, <em>description</em>, <em>repository</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.api.script_sql" title="Permalink to this definition">¶</a></dt>
<dd><p>%prog script_sql DATABASE DESCRIPTION REPOSITORY_PATH</p>
<p>Create empty change SQL scripts for given DATABASE, where DATABASE
is either specific (‘postgresql’, ‘mysql’, ‘oracle’, ‘sqlite’, etc.)
or generic (‘default’).</p>
<p>For instance, manage.py script_sql postgresql description creates:
repository/versions/001_description_postgresql_upgrade.sql and
repository/versions/001_description_postgresql_downgrade.sql</p>
</dd></dl>
</div>
<div class="section" id="module-migrate.versioning.genmodel">
<span id="module-genmodel-orm-model-generator"></span><h2>Module <a class="reference internal" href="#module-migrate.versioning.genmodel" title="migrate.versioning.genmodel: Python database model generator and differencer"><tt class="xref py py-mod docutils literal"><span class="pre">genmodel</span></tt></a> – ORM Model generator<a class="headerlink" href="#module-migrate.versioning.genmodel" title="Permalink to this headline">¶</a></h2>
<p>Code to generate a Python model from a database or differences
between a model and database.</p>
<p>Some of this is borrowed heavily from the AutoCode project at:
<a class="reference external" href="http://code.google.com/p/sqlautocode/">http://code.google.com/p/sqlautocode/</a></p>
<dl class="class">
<dt id="migrate.versioning.genmodel.ModelGenerator">
<em class="property">class </em><tt class="descclassname">migrate.versioning.genmodel.</tt><tt class="descname">ModelGenerator</tt><big>(</big><em>diff</em>, <em>engine</em>, <em>declarative=False</em><big>)</big><a class="headerlink" href="#migrate.versioning.genmodel.ModelGenerator" title="Permalink to this definition">¶</a></dt>
<dd><p>Various transformations from an A, B diff.</p>
<p>In the implementation, A tends to be called the model and B
the database (although this is not true of all diffs).
The diff is directionless, but transformations apply the diff
in a particular direction, described in the method name.</p>
<dl class="method">
<dt id="migrate.versioning.genmodel.ModelGenerator.genB2AMigration">
<tt class="descname">genB2AMigration</tt><big>(</big><em>indent=' '</em><big>)</big><a class="headerlink" href="#migrate.versioning.genmodel.ModelGenerator.genB2AMigration" title="Permalink to this definition">¶</a></dt>
<dd><p>Generate a migration from B to A.</p>
<p>Was: toUpgradeDowngradePython
Assume model (A) is most current and database (B) is out-of-date.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.genmodel.ModelGenerator.genBDefinition">
<tt class="descname">genBDefinition</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.versioning.genmodel.ModelGenerator.genBDefinition" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates the source code for a definition of B.</p>
<p>Assumes a diff where A is empty.</p>
<p>Was: toPython. Assume database (B) is current and model (A) is empty.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.genmodel.ModelGenerator.runB2A">
<tt class="descname">runB2A</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.versioning.genmodel.ModelGenerator.runB2A" title="Permalink to this definition">¶</a></dt>
<dd><p>Goes from B to A.</p>
<p>Was: applyModel. Apply model (A) to current database (B).</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-migrate.versioning.pathed">
<span id="module-pathed-path-utilities"></span><h2>Module <a class="reference internal" href="#module-migrate.versioning.pathed" title="migrate.versioning.pathed: File/Directory handling class"><tt class="xref py py-mod docutils literal"><span class="pre">pathed</span></tt></a> – Path utilities<a class="headerlink" href="#module-migrate.versioning.pathed" title="Permalink to this headline">¶</a></h2>
<p>A path/directory class.</p>
<dl class="class">
<dt id="migrate.versioning.pathed.Pathed">
<em class="property">class </em><tt class="descclassname">migrate.versioning.pathed.</tt><tt class="descname">Pathed</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.pathed.Pathed" title="Permalink to this definition">¶</a></dt>
<dd><p>A class associated with a path/directory tree.</p>
<p>Only one instance of this class may exist for a particular file;
__new__ will return an existing instance if possible</p>
<dl class="classmethod">
<dt id="migrate.versioning.pathed.Pathed.require_found">
<em class="property">classmethod </em><tt class="descname">require_found</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.pathed.Pathed.require_found" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensures a given path already exists</p>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.pathed.Pathed.require_notfound">
<em class="property">classmethod </em><tt class="descname">require_notfound</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.pathed.Pathed.require_notfound" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensures a given path does not already exist</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-migrate.versioning.repository">
<span id="module-repository-repository-management"></span><h2>Module <a class="reference internal" href="#module-migrate.versioning.repository" title="migrate.versioning.repository: SQLAlchemy migrate repository management"><tt class="xref py py-mod docutils literal"><span class="pre">repository</span></tt></a> – Repository management<a class="headerlink" href="#module-migrate.versioning.repository" title="Permalink to this headline">¶</a></h2>
<p>SQLAlchemy migrate repository management.</p>
<dl class="class">
<dt id="migrate.versioning.repository.Changeset">
<em class="property">class </em><tt class="descclassname">migrate.versioning.repository.</tt><tt class="descname">Changeset</tt><big>(</big><em>start</em>, <em>*changes</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Changeset" title="Permalink to this definition">¶</a></dt>
<dd><p>A collection of changes to be applied to a database.</p>
<p>Changesets are bound to a repository and manage a set of
scripts from that repository.</p>
<p>Behaves like a dict, for the most part. Keys are ordered based on step value.</p>
<dl class="method">
<dt id="migrate.versioning.repository.Changeset.add">
<tt class="descname">add</tt><big>(</big><em>change</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Changeset.add" title="Permalink to this definition">¶</a></dt>
<dd><p>Add new change to changeset</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.repository.Changeset.keys">
<tt class="descname">keys</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Changeset.keys" title="Permalink to this definition">¶</a></dt>
<dd><p>In a series of upgrades x -> y, keys are version x. Sorted.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.repository.Changeset.run">
<tt class="descname">run</tt><big>(</big><em>*p</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Changeset.run" title="Permalink to this definition">¶</a></dt>
<dd><p>Run the changeset scripts</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.versioning.repository.Repository">
<em class="property">class </em><tt class="descclassname">migrate.versioning.repository.</tt><tt class="descname">Repository</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Repository" title="Permalink to this definition">¶</a></dt>
<dd><p>A project’s change script repository</p>
<dl class="method">
<dt id="migrate.versioning.repository.Repository.changeset">
<tt class="descname">changeset</tt><big>(</big><em>database</em>, <em>start</em>, <em>end=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Repository.changeset" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a changeset to migrate this database from ver. start to end/latest.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>database</strong> (<em>string</em>) – name of database to generate changeset</li>
<li><strong>start</strong> (<em>int</em>) – version to start at</li>
<li><strong>end</strong> (<em>int</em>) – version to end at (latest if None given)</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><tt class="xref py py-class docutils literal"><span class="pre">Changeset</span> <span class="pre">instance</span></tt></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.repository.Repository.create">
<em class="property">classmethod </em><tt class="descname">create</tt><big>(</big><em>path</em>, <em>name</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Repository.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a repository at a specified path</p>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.repository.Repository.create_manage_file">
<em class="property">classmethod </em><tt class="descname">create_manage_file</tt><big>(</big><em>file_</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Repository.create_manage_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a project management script (manage.py)</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>file</strong> – Destination file to be written</li>
<li><strong>opts</strong> – Options that are passed to <a class="reference internal" href="#migrate.versioning.shell.main" title="migrate.versioning.shell.main"><tt class="xref py py-func docutils literal"><span class="pre">migrate.versioning.shell.main()</span></tt></a></li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.repository.Repository.create_script">
<tt class="descname">create_script</tt><big>(</big><em>description</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Repository.create_script" title="Permalink to this definition">¶</a></dt>
<dd><p>API to <a class="reference internal" href="#migrate.versioning.version.Collection.create_new_python_version" title="migrate.versioning.version.Collection.create_new_python_version"><tt class="xref py py-meth docutils literal"><span class="pre">migrate.versioning.version.Collection.create_new_python_version()</span></tt></a></p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.repository.Repository.create_script_sql">
<tt class="descname">create_script_sql</tt><big>(</big><em>database</em>, <em>description</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Repository.create_script_sql" title="Permalink to this definition">¶</a></dt>
<dd><p>API to <a class="reference internal" href="#migrate.versioning.version.Collection.create_new_sql_version" title="migrate.versioning.version.Collection.create_new_sql_version"><tt class="xref py py-meth docutils literal"><span class="pre">migrate.versioning.version.Collection.create_new_sql_version()</span></tt></a></p>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.repository.Repository.prepare_config">
<em class="property">classmethod </em><tt class="descname">prepare_config</tt><big>(</big><em>tmpl_dir</em>, <em>name</em>, <em>options=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Repository.prepare_config" title="Permalink to this definition">¶</a></dt>
<dd><p>Prepare a project configuration file for a new project.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>tmpl_dir</strong> (<em>string</em>) – Path to Repository template</li>
<li><strong>config_file</strong> (<em>string</em>) – Name of the config file in Repository template</li>
<li><strong>name</strong> (<em>string</em>) – Repository name</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">Populated config file</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.repository.Repository.verify">
<em class="property">classmethod </em><tt class="descname">verify</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Repository.verify" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensure the target path is a valid repository.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#migrate.exceptions.InvalidRepositoryError" title="migrate.exceptions.InvalidRepositoryError"><tt class="xref py py-exc docutils literal"><span class="pre">InvalidRepositoryError</span></tt></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.repository.Repository.version">
<tt class="descname">version</tt><big>(</big><em>*p</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.versioning.repository.Repository.version" title="Permalink to this definition">¶</a></dt>
<dd><p>API to <a class="reference internal" href="#migrate.versioning.version.Collection.version" title="migrate.versioning.version.Collection.version"><tt class="xref py py-attr docutils literal"><span class="pre">migrate.versioning.version.Collection.version</span></tt></a></p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.repository.Repository.id">
<tt class="descname">id</tt><a class="headerlink" href="#migrate.versioning.repository.Repository.id" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns repository id specified in config</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.repository.Repository.latest">
<tt class="descname">latest</tt><a class="headerlink" href="#migrate.versioning.repository.Repository.latest" title="Permalink to this definition">¶</a></dt>
<dd><p>API to <a class="reference internal" href="#migrate.versioning.version.Collection.latest" title="migrate.versioning.version.Collection.latest"><tt class="xref py py-attr docutils literal"><span class="pre">migrate.versioning.version.Collection.latest</span></tt></a></p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.repository.Repository.use_timestamp_numbering">
<tt class="descname">use_timestamp_numbering</tt><a class="headerlink" href="#migrate.versioning.repository.Repository.use_timestamp_numbering" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns use_timestamp_numbering specified in config</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.repository.Repository.version_table">
<tt class="descname">version_table</tt><a class="headerlink" href="#migrate.versioning.repository.Repository.version_table" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns version_table name specified in config</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-migrate.versioning.schema">
<span id="module-schema-migration-upgrade-downgrade"></span><h2>Module <a class="reference internal" href="#module-migrate.versioning.schema" title="migrate.versioning.schema: Database schema management"><tt class="xref py py-mod docutils literal"><span class="pre">schema</span></tt></a> – Migration upgrade/downgrade<a class="headerlink" href="#module-migrate.versioning.schema" title="Permalink to this headline">¶</a></h2>
<p>Database schema version management.</p>
<dl class="class">
<dt id="migrate.versioning.schema.ControlledSchema">
<em class="property">class </em><tt class="descclassname">migrate.versioning.schema.</tt><tt class="descname">ControlledSchema</tt><big>(</big><em>engine</em>, <em>repository</em><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema" title="Permalink to this definition">¶</a></dt>
<dd><p>A database under version control</p>
<dl class="method">
<dt id="migrate.versioning.schema.ControlledSchema.changeset">
<tt class="descname">changeset</tt><big>(</big><em>version=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema.changeset" title="Permalink to this definition">¶</a></dt>
<dd><p>API to Changeset creation.</p>
<p>Uses self.version for start version and engine.name
to get database name.</p>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.schema.ControlledSchema.compare_model_to_db">
<em class="property">classmethod </em><tt class="descname">compare_model_to_db</tt><big>(</big><em>engine</em>, <em>model</em>, <em>repository</em><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema.compare_model_to_db" title="Permalink to this definition">¶</a></dt>
<dd><p>Compare the current model against the current database.</p>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.schema.ControlledSchema.create">
<em class="property">classmethod </em><tt class="descname">create</tt><big>(</big><em>engine</em>, <em>repository</em>, <em>version=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Declare a database to be under a repository’s version control.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Raises :</th><td class="field-body"><tt class="xref py py-exc docutils literal"><span class="pre">DatabaseAlreadyControlledError</span></tt></td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><a class="reference internal" href="#migrate.versioning.schema.ControlledSchema" title="migrate.versioning.schema.ControlledSchema"><tt class="xref py py-class docutils literal"><span class="pre">ControlledSchema</span></tt></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.schema.ControlledSchema.create_model">
<em class="property">classmethod </em><tt class="descname">create_model</tt><big>(</big><em>engine</em>, <em>repository</em>, <em>declarative=False</em><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema.create_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Dump the current database as a Python model.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.schema.ControlledSchema.drop">
<tt class="descname">drop</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema.drop" title="Permalink to this definition">¶</a></dt>
<dd><p>Remove version control from a database.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.schema.ControlledSchema.load">
<tt class="descname">load</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema.load" title="Permalink to this definition">¶</a></dt>
<dd><p>Load controlled schema version info from DB</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.schema.ControlledSchema.update_db_from_model">
<tt class="descname">update_db_from_model</tt><big>(</big><em>model</em><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema.update_db_from_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Modify the database to match the structure of the current Python model.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.schema.ControlledSchema.update_repository_table">
<tt class="descname">update_repository_table</tt><big>(</big><em>startver</em>, <em>endver</em><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema.update_repository_table" title="Permalink to this definition">¶</a></dt>
<dd><p>Update version_table with new information</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.schema.ControlledSchema.upgrade">
<tt class="descname">upgrade</tt><big>(</big><em>version=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.schema.ControlledSchema.upgrade" title="Permalink to this definition">¶</a></dt>
<dd><p>Upgrade (or downgrade) to a specified version, or latest version.</p>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-migrate.versioning.schemadiff">
<span id="module-schemadiff-orm-model-differencing"></span><h2>Module <a class="reference internal" href="#module-migrate.versioning.schemadiff" title="migrate.versioning.schemadiff: Database schema and model differencing"><tt class="xref py py-mod docutils literal"><span class="pre">schemadiff</span></tt></a> – ORM Model differencing<a class="headerlink" href="#module-migrate.versioning.schemadiff" title="Permalink to this headline">¶</a></h2>
<p>Schema differencing support.</p>
<dl class="class">
<dt id="migrate.versioning.schemadiff.ColDiff">
<em class="property">class </em><tt class="descclassname">migrate.versioning.schemadiff.</tt><tt class="descname">ColDiff</tt><big>(</big><em>col_A</em>, <em>col_B</em><big>)</big><a class="headerlink" href="#migrate.versioning.schemadiff.ColDiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Container for differences in one <tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt>
between two <tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt> instances, <tt class="docutils literal"><span class="pre">A</span></tt>
and <tt class="docutils literal"><span class="pre">B</span></tt>.</p>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.ColDiff.col_A">
<tt class="descname">col_A</tt><a class="headerlink" href="#migrate.versioning.schemadiff.ColDiff.col_A" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt> object for A.</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.ColDiff.col_B">
<tt class="descname">col_B</tt><a class="headerlink" href="#migrate.versioning.schemadiff.ColDiff.col_B" title="Permalink to this definition">¶</a></dt>
<dd><p>The <tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt> object for B.</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.ColDiff.type_A">
<tt class="descname">type_A</tt><a class="headerlink" href="#migrate.versioning.schemadiff.ColDiff.type_A" title="Permalink to this definition">¶</a></dt>
<dd><p>The most generic type of the <tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt>
object in A.</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.ColDiff.type_B">
<tt class="descname">type_B</tt><a class="headerlink" href="#migrate.versioning.schemadiff.ColDiff.type_B" title="Permalink to this definition">¶</a></dt>
<dd><p>The most generic type of the <tt class="xref py py-class docutils literal"><span class="pre">Column</span></tt>
object in A.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.versioning.schemadiff.SchemaDiff">
<em class="property">class </em><tt class="descclassname">migrate.versioning.schemadiff.</tt><tt class="descname">SchemaDiff</tt><big>(</big><em>metadataA</em>, <em>metadataB</em>, <em>labelA='metadataA'</em>, <em>labelB='metadataB'</em>, <em>excludeTables=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.schemadiff.SchemaDiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Compute the difference between two <tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt>
objects.</p>
<p>The string representation of a <a class="reference internal" href="#migrate.versioning.schemadiff.SchemaDiff" title="migrate.versioning.schemadiff.SchemaDiff"><tt class="xref py py-class docutils literal"><span class="pre">SchemaDiff</span></tt></a> will summarise
the changes found between the two
<tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt> objects.</p>
<p>The length of a <a class="reference internal" href="#migrate.versioning.schemadiff.SchemaDiff" title="migrate.versioning.schemadiff.SchemaDiff"><tt class="xref py py-class docutils literal"><span class="pre">SchemaDiff</span></tt></a> will give the number of
changes found, enabling it to be used much like a boolean in
expressions.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>metadataA</strong> – First <tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt> to compare.</li>
<li><strong>metadataB</strong> – Second <tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt> to compare.</li>
<li><strong>labelA</strong> – The label to use in messages about the first
<tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt>.</li>
<li><strong>labelB</strong> – The label to use in messages about the second
<tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt>.</li>
<li><strong>excludeTables</strong> – A sequence of table names to exclude.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.SchemaDiff.tables_missing_from_A">
<tt class="descname">tables_missing_from_A</tt><a class="headerlink" href="#migrate.versioning.schemadiff.SchemaDiff.tables_missing_from_A" title="Permalink to this definition">¶</a></dt>
<dd><p>A sequence of table names that were found in B but weren’t in
A.</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.SchemaDiff.tables_missing_from_B">
<tt class="descname">tables_missing_from_B</tt><a class="headerlink" href="#migrate.versioning.schemadiff.SchemaDiff.tables_missing_from_B" title="Permalink to this definition">¶</a></dt>
<dd><p>A sequence of table names that were found in A but weren’t in
B.</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.SchemaDiff.tables_different">
<tt class="descname">tables_different</tt><a class="headerlink" href="#migrate.versioning.schemadiff.SchemaDiff.tables_different" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary containing information about tables that were found
to be different.
It maps table names to a <a class="reference internal" href="#migrate.versioning.schemadiff.TableDiff" title="migrate.versioning.schemadiff.TableDiff"><tt class="xref py py-class docutils literal"><span class="pre">TableDiff</span></tt></a> objects describing the
differences found.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.versioning.schemadiff.TableDiff">
<em class="property">class </em><tt class="descclassname">migrate.versioning.schemadiff.</tt><tt class="descname">TableDiff</tt><a class="headerlink" href="#migrate.versioning.schemadiff.TableDiff" title="Permalink to this definition">¶</a></dt>
<dd><p>Container for differences in one <tt class="xref py py-class docutils literal"><span class="pre">Table</span></tt>
between two <tt class="xref py py-class docutils literal"><span class="pre">MetaData</span></tt> instances, <tt class="docutils literal"><span class="pre">A</span></tt>
and <tt class="docutils literal"><span class="pre">B</span></tt>.</p>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.TableDiff.columns_missing_from_A">
<tt class="descname">columns_missing_from_A</tt><a class="headerlink" href="#migrate.versioning.schemadiff.TableDiff.columns_missing_from_A" title="Permalink to this definition">¶</a></dt>
<dd><p>A sequence of column names that were found in B but weren’t in
A.</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.TableDiff.columns_missing_from_B">
<tt class="descname">columns_missing_from_B</tt><a class="headerlink" href="#migrate.versioning.schemadiff.TableDiff.columns_missing_from_B" title="Permalink to this definition">¶</a></dt>
<dd><p>A sequence of column names that were found in A but weren’t in
B.</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.schemadiff.TableDiff.columns_different">
<tt class="descname">columns_different</tt><a class="headerlink" href="#migrate.versioning.schemadiff.TableDiff.columns_different" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary containing information about columns that were
found to be different.
It maps column names to a <a class="reference internal" href="#migrate.versioning.schemadiff.ColDiff" title="migrate.versioning.schemadiff.ColDiff"><tt class="xref py py-class docutils literal"><span class="pre">ColDiff</span></tt></a> objects describing the
differences found.</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.schemadiff.getDiffOfModelAgainstDatabase">
<tt class="descclassname">migrate.versioning.schemadiff.</tt><tt class="descname">getDiffOfModelAgainstDatabase</tt><big>(</big><em>metadata</em>, <em>engine</em>, <em>excludeTables=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.schemadiff.getDiffOfModelAgainstDatabase" title="Permalink to this definition">¶</a></dt>
<dd><p>Return differences of model against database.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">object which will evaluate to <tt class="xref std std-keyword xref docutils literal"><span class="pre">True</span></tt> if there are differences else <tt class="xref std std-keyword xref docutils literal"><span class="pre">False</span></tt>.</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.schemadiff.getDiffOfModelAgainstModel">
<tt class="descclassname">migrate.versioning.schemadiff.</tt><tt class="descname">getDiffOfModelAgainstModel</tt><big>(</big><em>metadataA</em>, <em>metadataB</em>, <em>excludeTables=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.schemadiff.getDiffOfModelAgainstModel" title="Permalink to this definition">¶</a></dt>
<dd><p>Return differences of model against another model.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">object which will evaluate to <tt class="xref std std-keyword xref docutils literal"><span class="pre">True</span></tt> if there are differences else <tt class="xref std std-keyword xref docutils literal"><span class="pre">False</span></tt>.</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-migrate.versioning.script.base">
<span id="module-script-script-actions"></span><h2>Module <tt class="xref py py-mod docutils literal"><span class="pre">script</span></tt> – Script actions<a class="headerlink" href="#module-migrate.versioning.script.base" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="migrate.versioning.script.base.BaseScript">
<em class="property">class </em><tt class="descclassname">migrate.versioning.script.base.</tt><tt class="descname">BaseScript</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.base.BaseScript" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for other types of scripts.
All scripts have the following properties:</p>
<dl class="docutils">
<dt>source (script.source())</dt>
<dd>The source code of the script</dd>
<dt>version (script.version())</dt>
<dd>The version number of the script</dd>
<dt>operations (script.operations())</dt>
<dd>The operations defined by the script: upgrade(), downgrade() or both.
Returns a tuple of operations.
Can also check for an operation with ex. script.operation(Script.ops.up)</dd>
</dl>
<dl class="method">
<dt id="migrate.versioning.script.base.BaseScript.run">
<tt class="descname">run</tt><big>(</big><em>engine</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.base.BaseScript.run" title="Permalink to this definition">¶</a></dt>
<dd><p>Core of each BaseScript subclass.
This method executes the script.</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.script.base.BaseScript.source">
<tt class="descname">source</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.versioning.script.base.BaseScript.source" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">source code of the script.</td>
</tr>
<tr class="field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.script.base.BaseScript.verify">
<em class="property">classmethod </em><tt class="descname">verify</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.base.BaseScript.verify" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensure this is a valid script
This version simply ensures the script file’s existence</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#migrate.exceptions.InvalidScriptError" title="migrate.exceptions.InvalidScriptError"><tt class="xref py py-exc docutils literal"><span class="pre">InvalidScriptError</span></tt></a></td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<span class="target" id="module-migrate.versioning.script.py"></span><dl class="class">
<dt id="migrate.versioning.script.py.PythonScript">
<em class="property">class </em><tt class="descclassname">migrate.versioning.script.py.</tt><tt class="descname">PythonScript</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#migrate.versioning.script.base.BaseScript" title="migrate.versioning.script.base.BaseScript"><tt class="xref py py-class docutils literal"><span class="pre">migrate.versioning.script.base.BaseScript</span></tt></a></p>
<p>Base for Python scripts</p>
<dl class="classmethod">
<dt id="migrate.versioning.script.py.PythonScript.create">
<em class="property">classmethod </em><tt class="descname">create</tt><big>(</big><em>path</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an empty migration script at specified path</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><a class="reference internal" href="#migrate.versioning.script.py.PythonScript" title="migrate.versioning.script.py.PythonScript"><tt class="xref py py-class docutils literal"><span class="pre">PythonScript</span> <span class="pre">instance</span></tt></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.script.py.PythonScript.make_update_script_for_model">
<em class="property">classmethod </em><tt class="descname">make_update_script_for_model</tt><big>(</big><em>engine</em>, <em>oldmodel</em>, <em>model</em>, <em>repository</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.make_update_script_for_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a migration script based on difference between two SA models.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>repository</strong> (string or <a class="reference internal" href="#migrate.versioning.repository.Repository" title="migrate.versioning.repository.Repository"><tt class="xref py py-class docutils literal"><span class="pre">Repository</span> <span class="pre">instance</span></tt></a>) – path to migrate repository</li>
<li><strong>oldmodel</strong> (<em>string or Class</em>) – dotted.module.name:SAClass or SAClass object</li>
<li><strong>model</strong> (<em>string or Class</em>) – dotted.module.name:SAClass or SAClass object</li>
<li><strong>engine</strong> (<em>Engine instance</em>) – SQLAlchemy engine</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">Upgrade / Downgrade script</p>
</td>
</tr>
<tr class="field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">string</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.script.py.PythonScript.preview_sql">
<tt class="descname">preview_sql</tt><big>(</big><em>url</em>, <em>step</em>, <em>**args</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.preview_sql" title="Permalink to this definition">¶</a></dt>
<dd><p>Mocks SQLAlchemy Engine to store all executed calls in a string
and runs <a class="reference internal" href="#migrate.versioning.script.py.PythonScript.run" title="migrate.versioning.script.py.PythonScript.run"><tt class="xref py py-meth docutils literal"><span class="pre">PythonScript.run</span></tt></a></p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">SQL file</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.script.py.PythonScript.require_found">
<em class="property">classmethod </em><tt class="descname">require_found</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.require_found" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensures a given path already exists</p>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.script.py.PythonScript.require_notfound">
<em class="property">classmethod </em><tt class="descname">require_notfound</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.require_notfound" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensures a given path does not already exist</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.script.py.PythonScript.run">
<tt class="descname">run</tt><big>(</big><em>engine</em>, <em>step</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.run" title="Permalink to this definition">¶</a></dt>
<dd><p>Core method of Script file.
Exectues <tt class="xref py py-func docutils literal"><span class="pre">update()</span></tt> or <tt class="xref py py-func docutils literal"><span class="pre">downgrade()</span></tt> functions</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first last simple">
<li><strong>engine</strong> (<em>string</em>) – SQLAlchemy Engine</li>
<li><strong>step</strong> (<em>int</em>) – Operation to run</li>
</ul>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.script.py.PythonScript.source">
<tt class="descname">source</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.source" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">source code of the script.</td>
</tr>
<tr class="field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.script.py.PythonScript.verify">
<em class="property">classmethod </em><tt class="descname">verify</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.verify" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensure this is a valid script
This version simply ensures the script file’s existence</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#migrate.exceptions.InvalidScriptError" title="migrate.exceptions.InvalidScriptError"><tt class="xref py py-exc docutils literal"><span class="pre">InvalidScriptError</span></tt></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.script.py.PythonScript.verify_module">
<em class="property">classmethod </em><tt class="descname">verify_module</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.verify_module" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensure path is a valid script</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>path</strong> (<em>string</em>) – Script location</td>
</tr>
<tr class="field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#migrate.exceptions.InvalidScriptError" title="migrate.exceptions.InvalidScriptError"><tt class="xref py py-exc docutils literal"><span class="pre">InvalidScriptError</span></tt></a></td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">Python module</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.script.py.PythonScript.module">
<tt class="descname">module</tt><a class="headerlink" href="#migrate.versioning.script.py.PythonScript.module" title="Permalink to this definition">¶</a></dt>
<dd><p>Calls <tt class="xref py py-meth docutils literal"><span class="pre">migrate.versioning.script.py.verify_module()</span></tt>
and returns it.</p>
</dd></dl>
</dd></dl>
<span class="target" id="module-migrate.versioning.script.sql"></span><dl class="class">
<dt id="migrate.versioning.script.sql.SqlScript">
<em class="property">class </em><tt class="descclassname">migrate.versioning.script.sql.</tt><tt class="descname">SqlScript</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.sql.SqlScript" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#migrate.versioning.script.base.BaseScript" title="migrate.versioning.script.base.BaseScript"><tt class="xref py py-class docutils literal"><span class="pre">migrate.versioning.script.base.BaseScript</span></tt></a></p>
<p>A file containing plain SQL statements.</p>
<dl class="classmethod">
<dt id="migrate.versioning.script.sql.SqlScript.create">
<em class="property">classmethod </em><tt class="descname">create</tt><big>(</big><em>path</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.sql.SqlScript.create" title="Permalink to this definition">¶</a></dt>
<dd><p>Create an empty migration script at specified path</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><a class="reference internal" href="#migrate.versioning.script.sql.SqlScript" title="migrate.versioning.script.sql.SqlScript"><tt class="xref py py-class docutils literal"><span class="pre">SqlScript</span> <span class="pre">instance</span></tt></a></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.script.sql.SqlScript.require_found">
<em class="property">classmethod </em><tt class="descname">require_found</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.sql.SqlScript.require_found" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensures a given path already exists</p>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.script.sql.SqlScript.require_notfound">
<em class="property">classmethod </em><tt class="descname">require_notfound</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.sql.SqlScript.require_notfound" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensures a given path does not already exist</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.script.sql.SqlScript.run">
<tt class="descname">run</tt><big>(</big><em>engine</em>, <em>step=None</em>, <em>executemany=True</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.sql.SqlScript.run" title="Permalink to this definition">¶</a></dt>
<dd><p>Runs SQL script through raw dbapi execute call</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.script.sql.SqlScript.source">
<tt class="descname">source</tt><big>(</big><big>)</big><a class="headerlink" href="#migrate.versioning.script.sql.SqlScript.source" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">source code of the script.</td>
</tr>
<tr class="field"><th class="field-name">Return type:</th><td class="field-body">string</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="classmethod">
<dt id="migrate.versioning.script.sql.SqlScript.verify">
<em class="property">classmethod </em><tt class="descname">verify</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.script.sql.SqlScript.verify" title="Permalink to this definition">¶</a></dt>
<dd><p>Ensure this is a valid script
This version simply ensures the script file’s existence</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Raises :</th><td class="field-body"><a class="reference internal" href="#migrate.exceptions.InvalidScriptError" title="migrate.exceptions.InvalidScriptError"><tt class="xref py py-exc docutils literal"><span class="pre">InvalidScriptError</span></tt></a></td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="module-migrate.versioning.shell">
<span id="module-shell-cli-interface"></span><h2>Module <a class="reference internal" href="#module-migrate.versioning.shell" title="migrate.versioning.shell: Shell commands"><tt class="xref py py-mod docutils literal"><span class="pre">shell</span></tt></a> – CLI interface<a class="headerlink" href="#module-migrate.versioning.shell" title="Permalink to this headline">¶</a></h2>
<p>The migrate command-line tool.</p>
<dl class="function">
<dt id="migrate.versioning.shell.main">
<tt class="descclassname">migrate.versioning.shell.</tt><tt class="descname">main</tt><big>(</big><em>argv=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#migrate.versioning.shell.main" title="Permalink to this definition">¶</a></dt>
<dd><p>Shell interface to <a class="reference internal" href="#module-migrate.versioning.api" title="migrate.versioning.api: External API for :mod:`migrate.versioning`"><tt class="xref py py-mod docutils literal"><span class="pre">migrate.versioning.api</span></tt></a>.</p>
<p>kwargs are default options that can be overriden with passing
–some_option as command line option</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>disable_logging</strong> (<em>bool</em>) – Let migrate configure logging</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
<div class="section" id="module-migrate.versioning.util">
<span id="module-util-various-utility-functions"></span><h2>Module <a class="reference internal" href="#module-migrate.versioning.util" title="migrate.versioning.util: Utility functions"><tt class="xref py py-mod docutils literal"><span class="pre">util</span></tt></a> – Various utility functions<a class="headerlink" href="#module-migrate.versioning.util" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="migrate.versioning.util.Memoize">
<em class="property">class </em><tt class="descclassname">migrate.versioning.util.</tt><tt class="descname">Memoize</tt><big>(</big><em>fn</em><big>)</big><a class="headerlink" href="#migrate.versioning.util.Memoize" title="Permalink to this definition">¶</a></dt>
<dd><p>Memoize(fn) - an instance which acts like fn but memoizes its arguments
Will only work on functions with non-mutable arguments</p>
<p>ActiveState Code 52201</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.util.asbool">
<tt class="descclassname">migrate.versioning.util.</tt><tt class="descname">asbool</tt><big>(</big><em>obj</em><big>)</big><a class="headerlink" href="#migrate.versioning.util.asbool" title="Permalink to this definition">¶</a></dt>
<dd><p>Do everything to use object as bool</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.util.catch_known_errors">
<tt class="descclassname">migrate.versioning.util.</tt><tt class="descname">catch_known_errors</tt><big>(</big><em>f</em><big>)</big><a class="headerlink" href="#migrate.versioning.util.catch_known_errors" title="Permalink to this definition">¶</a></dt>
<dd><p>Decorator that catches known api errors</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.util.construct_engine">
<tt class="descclassname">migrate.versioning.util.</tt><tt class="descname">construct_engine</tt><big>(</big><em>engine</em>, <em>**opts</em><big>)</big><a class="headerlink" href="#migrate.versioning.util.construct_engine" title="Permalink to this definition">¶</a></dt>
<dd><p class="versionadded">
<span class="versionmodified">New in version 0.5.4.</span></p>
<p>Constructs and returns SQLAlchemy engine.</p>
<p>Currently, there are 2 ways to pass create_engine options to <a class="reference internal" href="#module-migrate.versioning.api" title="migrate.versioning.api: External API for :mod:`migrate.versioning`"><tt class="xref py py-mod docutils literal"><span class="pre">migrate.versioning.api</span></tt></a> functions:</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>engine</strong> (<em>string or Engine instance</em>) – connection string or a existing engine</li>
<li><strong>engine_dict</strong> (<em>dict</em>) – python dictionary of options to pass to <cite>create_engine</cite></li>
<li><strong>engine_arg_*</strong> (<em>string</em>) – keyword parameters to pass to <cite>create_engine</cite> (evaluated with <a class="reference internal" href="#migrate.versioning.util.guess_obj_type" title="migrate.versioning.util.guess_obj_type"><tt class="xref py py-func docutils literal"><span class="pre">migrate.versioning.util.guess_obj_type()</span></tt></a>)</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">SQLAlchemy Engine</p>
</td>
</tr>
</tbody>
</table>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">keyword parameters override <tt class="docutils literal"><span class="pre">engine_dict</span></tt> values.</p>
</div>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.util.guess_obj_type">
<tt class="descclassname">migrate.versioning.util.</tt><tt class="descname">guess_obj_type</tt><big>(</big><em>obj</em><big>)</big><a class="headerlink" href="#migrate.versioning.util.guess_obj_type" title="Permalink to this definition">¶</a></dt>
<dd><p>Do everything to guess object type from string</p>
<p>Tries to convert to <cite>int</cite>, <cite>bool</cite> and finally returns if not succeded.</p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.util.load_model">
<tt class="descclassname">migrate.versioning.util.</tt><tt class="descname">load_model</tt><big>(</big><em>dotted_name</em><big>)</big><a class="headerlink" href="#migrate.versioning.util.load_model" title="Permalink to this definition">¶</a></dt>
<dd><p>Import module and use module-level variable”.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters:</th><td class="field-body"><strong>dotted_name</strong> – path to model in form of string: <tt class="docutils literal"><span class="pre">some.python.module:Class</span></tt></td>
</tr>
</tbody>
</table>
<p class="versionchanged">
<span class="versionmodified">Changed in version 0.5.4.</span></p>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.util.with_engine">
<tt class="descclassname">migrate.versioning.util.</tt><tt class="descname">with_engine</tt><big>(</big><em>f</em><big>)</big><a class="headerlink" href="#migrate.versioning.util.with_engine" title="Permalink to this definition">¶</a></dt>
<dd><p>Decorator for <a class="reference internal" href="#module-migrate.versioning.api" title="migrate.versioning.api: External API for :mod:`migrate.versioning`"><tt class="xref py py-mod docutils literal"><span class="pre">migrate.versioning.api</span></tt></a> functions
to safely close resources after function usage.</p>
<p>Passes engine parameters to <a class="reference internal" href="#migrate.versioning.util.construct_engine" title="migrate.versioning.util.construct_engine"><tt class="xref py py-func docutils literal"><span class="pre">construct_engine()</span></tt></a> and
resulting parameter is available as kw[‘engine’].</p>
<p>Engine is disposed after wrapped function is executed.</p>
</dd></dl>
</div>
<div class="section" id="module-migrate.versioning.version">
<span id="module-version-versioning-management"></span><h2>Module <a class="reference internal" href="#module-migrate.versioning.version" title="migrate.versioning.version: Version management"><tt class="xref py py-mod docutils literal"><span class="pre">version</span></tt></a> – Versioning management<a class="headerlink" href="#module-migrate.versioning.version" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="migrate.versioning.version.Collection">
<em class="property">class </em><tt class="descclassname">migrate.versioning.version.</tt><tt class="descname">Collection</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.version.Collection" title="Permalink to this definition">¶</a></dt>
<dd><p>A collection of versioning scripts in a repository</p>
<dl class="method">
<dt id="migrate.versioning.version.Collection.create_new_python_version">
<tt class="descname">create_new_python_version</tt><big>(</big><em>description</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.versioning.version.Collection.create_new_python_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Create Python files for new version</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.version.Collection.create_new_sql_version">
<tt class="descname">create_new_sql_version</tt><big>(</big><em>database</em>, <em>description</em>, <em>**k</em><big>)</big><a class="headerlink" href="#migrate.versioning.version.Collection.create_new_sql_version" title="Permalink to this definition">¶</a></dt>
<dd><p>Create SQL files for new version</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.version.Collection.version">
<tt class="descname">version</tt><big>(</big><em>vernum=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.version.Collection.version" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns latest Version if vernum is not given.
Otherwise, returns wanted version</p>
</dd></dl>
<dl class="attribute">
<dt id="migrate.versioning.version.Collection.latest">
<tt class="descname">latest</tt><a class="headerlink" href="#migrate.versioning.version.Collection.latest" title="Permalink to this definition">¶</a></dt>
<dd><table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns:</th><td class="field-body">Latest version in Collection</td>
</tr>
</tbody>
</table>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="migrate.versioning.version.Extensions">
<em class="property">class </em><tt class="descclassname">migrate.versioning.version.</tt><tt class="descname">Extensions</tt><a class="headerlink" href="#migrate.versioning.version.Extensions" title="Permalink to this definition">¶</a></dt>
<dd><p>A namespace for file extensions</p>
</dd></dl>
<dl class="class">
<dt id="migrate.versioning.version.VerNum">
<em class="property">class </em><tt class="descclassname">migrate.versioning.version.</tt><tt class="descname">VerNum</tt><big>(</big><em>value</em><big>)</big><a class="headerlink" href="#migrate.versioning.version.VerNum" title="Permalink to this definition">¶</a></dt>
<dd><p>A version number that behaves like a string and int at the same time</p>
</dd></dl>
<dl class="class">
<dt id="migrate.versioning.version.Version">
<em class="property">class </em><tt class="descclassname">migrate.versioning.version.</tt><tt class="descname">Version</tt><big>(</big><em>vernum</em>, <em>path</em>, <em>filelist</em><big>)</big><a class="headerlink" href="#migrate.versioning.version.Version" title="Permalink to this definition">¶</a></dt>
<dd><p>A single version in a collection
:param vernum: Version Number
:param path: Path to script files
:param filelist: List of scripts
:type vernum: int, VerNum
:type path: string
:type filelist: list</p>
<dl class="method">
<dt id="migrate.versioning.version.Version.add_script">
<tt class="descname">add_script</tt><big>(</big><em>path</em><big>)</big><a class="headerlink" href="#migrate.versioning.version.Version.add_script" title="Permalink to this definition">¶</a></dt>
<dd><p>Add script to Collection/Version</p>
</dd></dl>
<dl class="method">
<dt id="migrate.versioning.version.Version.script">
<tt class="descname">script</tt><big>(</big><em>database=None</em>, <em>operation=None</em><big>)</big><a class="headerlink" href="#migrate.versioning.version.Version.script" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns SQL or Python Script</p>
</dd></dl>
</dd></dl>
<dl class="function">
<dt id="migrate.versioning.version.str_to_filename">
<tt class="descclassname">migrate.versioning.version.</tt><tt class="descname">str_to_filename</tt><big>(</big><em>s</em><big>)</big><a class="headerlink" href="#migrate.versioning.version.str_to_filename" title="Permalink to this definition">¶</a></dt>
<dd><p>Replaces spaces, (double and single) quotes
and double underscores to underscores</p>
</dd></dl>
</div>
</div>
<div class="section" id="module-migrate.exceptions">
<span id="module-exceptions-exception-definitions"></span><h1>Module <a class="reference internal" href="#module-migrate.exceptions" title="migrate.exceptions: Migrate exception classes"><tt class="xref py py-mod docutils literal"><span class="pre">exceptions</span></tt></a> – Exception definitions<a class="headerlink" href="#module-migrate.exceptions" title="Permalink to this headline">¶</a></h1>
<p>Provide exception classes for <a class="reference internal" href="index.html#module-migrate" title="migrate"><tt class="xref py py-mod docutils literal"><span class="pre">migrate</span></tt></a></p>
<dl class="exception">
<dt id="migrate.exceptions.ApiError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">ApiError</tt><a class="headerlink" href="#migrate.exceptions.ApiError" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for API errors.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.ControlledSchemaError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">ControlledSchemaError</tt><a class="headerlink" href="#migrate.exceptions.ControlledSchemaError" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for controlled schema errors.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.DatabaseAlreadyControlledError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">DatabaseAlreadyControlledError</tt><a class="headerlink" href="#migrate.exceptions.DatabaseAlreadyControlledError" title="Permalink to this definition">¶</a></dt>
<dd><p>Database shouldn’t be under version control, but it is</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.DatabaseNotControlledError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">DatabaseNotControlledError</tt><a class="headerlink" href="#migrate.exceptions.DatabaseNotControlledError" title="Permalink to this definition">¶</a></dt>
<dd><p>Database should be under version control, but it’s not.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.Error">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">Error</tt><a class="headerlink" href="#migrate.exceptions.Error" title="Permalink to this definition">¶</a></dt>
<dd><p>Error base class.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.InvalidConstraintError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">InvalidConstraintError</tt><a class="headerlink" href="#migrate.exceptions.InvalidConstraintError" title="Permalink to this definition">¶</a></dt>
<dd><p>Invalid constraint error</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.InvalidRepositoryError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">InvalidRepositoryError</tt><a class="headerlink" href="#migrate.exceptions.InvalidRepositoryError" title="Permalink to this definition">¶</a></dt>
<dd><p>Invalid repository error.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.InvalidScriptError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">InvalidScriptError</tt><a class="headerlink" href="#migrate.exceptions.InvalidScriptError" title="Permalink to this definition">¶</a></dt>
<dd><p>Invalid script error.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.InvalidVersionError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">InvalidVersionError</tt><a class="headerlink" href="#migrate.exceptions.InvalidVersionError" title="Permalink to this definition">¶</a></dt>
<dd><p>Invalid version error.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.KnownError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">KnownError</tt><a class="headerlink" href="#migrate.exceptions.KnownError" title="Permalink to this definition">¶</a></dt>
<dd><p>A known error condition.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.MigrateDeprecationWarning">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">MigrateDeprecationWarning</tt><a class="headerlink" href="#migrate.exceptions.MigrateDeprecationWarning" title="Permalink to this definition">¶</a></dt>
<dd><p>Warning for deprecated features in Migrate</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.NoSuchTableError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">NoSuchTableError</tt><a class="headerlink" href="#migrate.exceptions.NoSuchTableError" title="Permalink to this definition">¶</a></dt>
<dd><p>The table does not exist.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.NotSupportedError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">NotSupportedError</tt><a class="headerlink" href="#migrate.exceptions.NotSupportedError" title="Permalink to this definition">¶</a></dt>
<dd><p>Not supported error</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.PathError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">PathError</tt><a class="headerlink" href="#migrate.exceptions.PathError" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for path errors.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.PathFoundError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">PathFoundError</tt><a class="headerlink" href="#migrate.exceptions.PathFoundError" title="Permalink to this definition">¶</a></dt>
<dd><p>A path with a file was required; found no file.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.PathNotFoundError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">PathNotFoundError</tt><a class="headerlink" href="#migrate.exceptions.PathNotFoundError" title="Permalink to this definition">¶</a></dt>
<dd><p>A path with no file was required; found a file.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.RepositoryError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">RepositoryError</tt><a class="headerlink" href="#migrate.exceptions.RepositoryError" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for repository errors.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.ScriptError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">ScriptError</tt><a class="headerlink" href="#migrate.exceptions.ScriptError" title="Permalink to this definition">¶</a></dt>
<dd><p>Base class for script errors.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.UsageError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">UsageError</tt><a class="headerlink" href="#migrate.exceptions.UsageError" title="Permalink to this definition">¶</a></dt>
<dd><p>A known error condition where help should be displayed.</p>
</dd></dl>
<dl class="exception">
<dt id="migrate.exceptions.WrongRepositoryError">
<em class="property">exception </em><tt class="descclassname">migrate.exceptions.</tt><tt class="descname">WrongRepositoryError</tt><a class="headerlink" href="#migrate.exceptions.WrongRepositoryError" title="Permalink to this definition">¶</a></dt>
<dd><p>This database is under version control by another repository.</p>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Module <tt class="docutils literal"><span class="pre">migrate.changeset</span></tt> – Schema changes</a><ul>
<li><a class="reference internal" href="#module-migrate.changeset">Module <tt class="docutils literal"><span class="pre">migrate.changeset</span></tt> – Schema migration API</a></li>
<li><a class="reference internal" href="#module-migrate.changeset.ansisql">Module <tt class="docutils literal"><span class="pre">ansisql</span></tt> – Standard SQL implementation</a></li>
<li><a class="reference internal" href="#module-migrate.changeset.constraint">Module <tt class="docutils literal"><span class="pre">constraint</span></tt> – Constraint schema migration API</a></li>
<li><a class="reference internal" href="#module-migrate.changeset.databases">Module <tt class="docutils literal"><span class="pre">databases</span></tt> – Database specific schema migration</a><ul>
<li><a class="reference internal" href="#module-migrate.changeset.databases.mysql">Module <tt class="docutils literal"><span class="pre">mysql</span></tt></a></li>
<li><a class="reference internal" href="#module-migrate.changeset.databases.firebird">Module <tt class="docutils literal"><span class="pre">firebird</span></tt></a></li>
<li><a class="reference internal" href="#module-migrate.changeset.databases.oracle">Module <tt class="docutils literal"><span class="pre">oracle</span></tt></a></li>
<li><a class="reference internal" href="#module-migrate.changeset.databases.postgres">Module <tt class="docutils literal"><span class="pre">postgres</span></tt></a></li>
<li><a class="reference internal" href="#module-migrate.changeset.databases.sqlite">Module <tt class="docutils literal"><span class="pre">sqlite</span></tt></a></li>
<li><a class="reference internal" href="#module-migrate.changeset.databases.visitor">Module <tt class="docutils literal"><span class="pre">visitor</span></tt></a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-migrate.changeset.schema">Module <tt class="docutils literal"><span class="pre">schema</span></tt> – Additional API to SQLAlchemy for migrations</a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-migrate.versioning">Module <tt class="docutils literal"><span class="pre">migrate.versioning</span></tt> – Database versioning and repository management</a><ul>
<li><a class="reference internal" href="#module-migrate.versioning.api">Module <tt class="docutils literal"><span class="pre">api</span></tt> – Python API commands</a></li>
<li><a class="reference internal" href="#module-migrate.versioning.genmodel">Module <tt class="docutils literal"><span class="pre">genmodel</span></tt> – ORM Model generator</a></li>
<li><a class="reference internal" href="#module-migrate.versioning.pathed">Module <tt class="docutils literal"><span class="pre">pathed</span></tt> – Path utilities</a></li>
<li><a class="reference internal" href="#module-migrate.versioning.repository">Module <tt class="docutils literal"><span class="pre">repository</span></tt> – Repository management</a></li>
<li><a class="reference internal" href="#module-migrate.versioning.schema">Module <tt class="docutils literal"><span class="pre">schema</span></tt> – Migration upgrade/downgrade</a></li>
<li><a class="reference internal" href="#module-migrate.versioning.schemadiff">Module <tt class="docutils literal"><span class="pre">schemadiff</span></tt> – ORM Model differencing</a></li>
<li><a class="reference internal" href="#module-migrate.versioning.script.base">Module <tt class="docutils literal"><span class="pre">script</span></tt> – Script actions</a></li>
<li><a class="reference internal" href="#module-migrate.versioning.shell">Module <tt class="docutils literal"><span class="pre">shell</span></tt> – CLI interface</a></li>
<li><a class="reference internal" href="#module-migrate.versioning.util">Module <tt class="docutils literal"><span class="pre">util</span></tt> – Various utility functions</a></li>
<li><a class="reference internal" href="#module-migrate.versioning.version">Module <tt class="docutils literal"><span class="pre">version</span></tt> – Versioning management</a></li>
</ul>
</li>
<li><a class="reference internal" href="#module-migrate.exceptions">Module <tt class="docutils literal"><span class="pre">exceptions</span></tt> – Exception definitions</a></li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="glossary.html"
title="previous chapter">Glossary</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="changelog.html"
title="next chapter">0.7.2 (2011-11-01)</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/api.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="changelog.html" title="0.7.2 (2011-11-01)"
>next</a> |</li>
<li class="right" >
<a href="glossary.html" title="Glossary"
>previous</a> |</li>
<li><a href="index.html">SQLAlchemy Migrate v0.7.2 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2011, Evan Rosson, Jan Dittberner, Domen Kožar, Chris Withers.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.8.
</div>
</body>
</html>
|