summaryrefslogtreecommitdiff
path: root/docs/build/changelog.rst
blob: 7762a093bd929b1eca2dae01fe007a99911775b3 (plain)
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
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387

==========
Changelog
==========

.. changelog::
    :version: 1.10.1
    :include_notes_from: unreleased

.. changelog::
    :version: 1.10.0
    :released: March 5, 2023

    .. change::
        :tags: bug, autogenerate
        :tickets: 1166

        Fixed issue in index detection where autogenerate change detection would
        consider indexes with the same columns but with different order as equal,
        while in general they are not equivalent in how a database will use them.

    .. change::
        :tags: feature, revisioning
        :tickets: 760

        Recursive traversal of revision files in a particular revision directory is
        now supported, by indicating ``recursive_version_locations = true`` in
        alembic.ini. Pull request courtesy ostr00000.


    .. change::
        :tags: bug, autogenerate, sqlite
        :tickets: 1165

        Fixed issue where indexes on SQLite which include SQL expressions would not
        compare correctly, generating false positives under autogenerate. These
        indexes are now skipped, generating a warning, in the same way that
        expression-based indexes on PostgreSQL are skipped and generate warnings
        when SQLAlchemy 1.x installations are in use. Note that reflection of
        SQLite expression-based indexes continues to not yet be supported under
        SQLAlchemy 2.0, even though PostgreSQL expression-based indexes have now
        been implemented.



    .. change::
        :tags: bug, mssql
        :tickets: 1187

        Properly escape constraint name on SQL Server when dropping
        a column while specifying ``mssql_drop_default=True`` or
        ``mssql_drop_check=True`` or ``mssql_drop_foreign_key=True``.


    .. change::
        :tags: usecase, autogenerate, postgresql

        Added support for autogenerate comparison of indexes on PostgreSQL which
        include SQL expressions, when using SQLAlchemy 2.0; the previous warning
        that such indexes were skipped are removed when the new functionality
        is in use.  When using SQLAlchemy versions prior to the 2.0 series,
        the indexes continue to be skipped with a warning.

.. changelog::
    :version: 1.9.4
    :released: February 16, 2023

    .. change::
        :tags: bug, mssql
        :tickets: 1177

        Ongoing fixes for SQL Server server default comparisons under autogenerate,
        adjusting for SQL Server's collapsing of whitespace between SQL function
        arguments when reporting on a function-based server default, as well as its
        arbitrary addition of parenthesis within arguments; the approach has now
        been made more aggressive by stripping the two default strings to compare
        of all whitespace, parenthesis, and quoting characters.


    .. change::
        :tags: bug, postgresql

        Fixed PostgreSQL server default comparison to handle SQL expressions
        sent as ``text()`` constructs, such as ``text("substring('name', 1, 3)")``,
        which previously would raise errors when attempting to run a server-based
        comparison.



    .. change::
        :tags: bug, autogenerate
        :tickets: 1180

        Removed a mis-use of the
        :paramref:`.EnvironmentContext.configure.render_item` callable where the
        "server_default" renderer would be erroneously used within the server
        default comparison process, which is working against SQL expressions, not
        Python code.

    .. change::
        :tags: bug, commands

        Fixed regression introduced in 1.7.0 where the "config" object passed to
        the template context when running the :func:`.merge` command
        programmatically failed to be correctly populated. Pull request courtesy
        Brendan Gann.

.. changelog::
    :version: 1.9.3
    :released: February 7, 2023

    .. change::
        :tags: bug, autogenerate
        :tickets: 1167

        Fixed issue where rendering of user-defined types that then went onto use
        the ``.with_variant()`` method would fail to render, if using SQLAlchemy
        2.0's version of variants.


.. changelog::
    :version: 1.9.2
    :released: January 14, 2023

    .. change::
        :tags: bug, typing
        :tickets: 1146, 1147

        Fixed typing definitions for :meth:`.EnvironmentContext.get_x_argument`.

        Typing stubs are now generated for overloaded proxied methods such as
        :meth:`.EnvironmentContext.get_x_argument`.

    .. change::
        :tags: bug, autogenerate
        :tickets: 1152

        Fixed regression caused by :ticket:`1145` where the string transformations
        applied to server defaults caused expressions such as ``(getdate())`` to no
        longer compare as equivalent on SQL Server, others.

.. changelog::
    :version: 1.9.1
    :released: December 23, 2022

    .. change::
        :tags: bug, autogenerate
        :tickets: 1145

        Fixed issue where server default compare would not work for string defaults
        that contained backslashes, due to mis-rendering of these values when
        comparing their contents.


    .. change::
        :tags: bug, oracle

        Implemented basic server default comparison for the Oracle backend;
        previously, Oracle's formatting of reflected defaults prevented any
        matches from occurring.

    .. change::
        :tags: bug, sqlite

        Adjusted SQLite's compare server default implementation to better handle
        defaults with or without parens around them, from both the reflected and
        the local metadata side.

    .. change::
        :tags: bug, mssql

        Adjusted SQL Server's compare server default implementation to better
        handle defaults with or without parens around them, from both the reflected
        and the local metadata side.

.. changelog::
    :version: 1.9.0
    :released: December 15, 2022

    .. change::
        :tags: feature, commands
        :tickets: 724

        Added new Alembic command ``alembic check``. This performs the widely
        requested feature of running an "autogenerate" comparison between the
        current database and the :class:`.MetaData` that's currently set up for
        autogenerate, returning an error code if the two do not match, based on
        current autogenerate settings. Pull request courtesy Nathan Louie.

        .. seealso::

            :ref:`alembic_check`


    .. change::
        :tags: bug, tests

        Fixed issue in tox.ini file where changes in the tox 4.0 series to the
        format of "passenv" caused tox to not function correctly, in particular
        raising an error as of tox 4.0.6.

    .. change::
        :tags: bug, typing
        :tickets: 1110

        Fixed typing issue where :paramref:`.revision.process_revision_directives`
        was not fully typed; additionally ensured all ``Callable`` and ``Dict``
        arguments to :meth:`.EnvironmentContext.configure` include parameters in
        the typing declaration.

        Additionally updated the codebase for Mypy 0.990 compliance.

.. changelog::
    :version: 1.8.1
    :released: July 13, 2022

    .. change::
        :tags: bug, sqlite
        :tickets: 1065

        Fixed bug where the SQLite implementation of
        :meth:`.Operations.rename_table` would render an explicit schema name for
        both the old and new table name, which while is the standard ALTER syntax,
        is not accepted by SQLite's syntax which doesn't support a rename across
        schemas. In particular, the syntax issue would prevent batch mode from
        working for SQLite databases that made use of attached databases (which are
        treated as "schemas" in SQLAlchemy).

    .. change::
        :tags: bug, batch
        :tickets: 1021

        Added an error raise for the condition where
        :meth:`.Operations.batch_alter_table` is used in ``--sql`` mode, where the
        operation requires table reflection, as is the case when running against
        SQLite without giving it a fixed ``Table`` object. Previously the operation
        would fail with an internal error.   To get a "move and copy" batch
        operation as a SQL script without connecting to a database,
        a ``Table`` object should be passed to the
        :paramref:`.Operations.batch_alter_table.copy_from` parameter so that
        reflection may be skipped.

.. changelog::
    :version: 1.8.0
    :released: May 31, 2022

    .. change::
        :tags: feature, typing
        :tickets: 764

        :pep:`484` typing annotations have been added to the ``env.py`` and
        revision template files within migration templates. Pull request by Nikita
        Sobolev.

    .. change::
        :tags: usecase, operations
        :tickets: 1037

        The ``op.drop_table()`` operation directive will now trigger the
        ``before_drop()`` and ``after_drop()`` DDL event hooks at the table level,
        which is similar to how the ``before_create()`` and ``after_create()``
        hooks are triggered by the ``op.create_table()`` directive. Note that as
        ``op.drop_table()`` accepts only a table name and optional schema name, the
        ``Table`` object received by the event will not have any information within
        it other than the table name and schema name.

    .. change::
        :tags: installation, changed
        :tickets: 1025

        Alembic 1.8 now supports Python 3.7 and above.

    .. change::
        :tags: changed, environment
        :tickets: 987

        The "Pylons" environment template has been removed as of Alembic 1.8. This
        template was based on the very old pre-Pyramid Pylons web framework which
        has been long superseded by Pyramid.

    .. change::
        :tags: bug, revisioning
        :tickets: 1026

        Fixed issue where a downgrade using a relative revision would
        fail in case of multiple branches with a single effectively
        head due to interdependencies between revisions.

    .. change::
      :tags: usecase, commands
      :tickets: 1027

      Added new token ``epoch`` to the ``file_template`` option, which will
      populate the integer epoch as determined by ``int(create_date.timestamp())``.
      Pull request courtesy Caio Carvalho.

    .. change::
        :tags: bug, batch
        :tickets: 1034

        Fixed issue in batch mode where CREATE INDEX would not use a new column
        name in the case of a column rename.

.. changelog::
    :version: 1.7.7
    :released: March 14, 2022

    .. change::
        :tags: bug, operations
        :tickets: 1004

        Fixed issue where using :meth:`.Operations.create_table` in conjunction
        with a :class:`.CheckConstraint` that referred to table-bound
        :class:`.Column` objects rather than string expressions would be added to
        the parent table potentially multiple times, resulting in an incorrect DDL
        sequence. Pull request courtesy Nicolas CANIART.

    .. change::
        :tags: bug, environment
        :tickets: 986

        The ``logging.fileConfig()`` line in ``env.py`` templates, which is used
        to setup Python logging for the migration run, is now conditional on
        :attr:`.Config.config_file_name` not being ``None``.  Otherwise, the line
        is skipped as there is no default logging configuration present.


    .. change::
        :tags: bug, mssql
        :tickets: 977

        Fixed bug where an :meth:`.Operations.alter_column` operation would change
        a "NOT NULL" column to "NULL" by emitting an ALTER COLUMN statement that
        did not specify "NOT NULL". (In the absence of "NOT NULL" T-SQL was
        implicitly assuming "NULL"). An :meth:`.Operations.alter_column` operation
        that specifies :paramref:`.Operations.alter_column.type` should also
        specify include either :paramref:`.Operations.alter_column.nullable` or
        :paramref:`.Operations.alter_column.existing_nullable` to inform Alembic as
        to whether the emitted DDL should include "NULL" or "NOT NULL"; a warning
        is now emitted if this is missing under this scenario.

.. changelog::
    :version: 1.7.6
    :released: February 1, 2022

    .. change::
        :tags: bug, batch, regression
        :tickets: 982

        Fixed regression where usage of a ``with_variant()`` datatype in
        conjunction with the ``existing_type`` option of ``op.alter_column()``
        under batch mode would lead to an internal exception.

    .. change::
        :tags: usecase, commands
        :tickets: 964

        Add a new command ``alembic ensure_version``, which will ensure that the
        Alembic version table is present in the target database, but does not
        alter its contents.  Pull request courtesy Kai Mueller.

    .. change::
        :tags: bug, autogenerate

        Implemented support for recognizing and rendering SQLAlchemy "variant"
        types going forward into SQLAlchemy 2.0, where the architecture of
        "variant" datatypes will be changing.


    .. change::
        :tags: bug, mysql, autogenerate
        :tickets: 968

        Added a rule to the MySQL impl so that the translation between JSON /
        LONGTEXT is accommodated by autogenerate, treating LONGTEXT from the server
        as equivalent to an existing JSON in the model.

    .. change::
        :tags: mssql

        Removed a warning raised by SQLAlchemy when dropping constraints
        on MSSQL regarding statement caching.

.. changelog::
    :version: 1.7.5
    :released: November 11, 2021

    .. change::
        :tags: bug, tests

        Adjustments to the test suite to accommodate for error message changes
        occurring as of SQLAlchemy 1.4.27.

.. changelog::
    :version: 1.7.4
    :released: October 6, 2021

    .. change::
        :tags: bug, regression
        :tickets: 934

        Fixed a regression that prevented the use of post write hooks
        on python version lower than 3.9

    .. change::
        :tags: bug, environment
        :tickets: 944

        Fixed issue where the :meth:`.MigrationContext.autocommit_block` feature
        would fail to function when using a SQLAlchemy engine using 2.0 future
        mode.


.. changelog::
    :version: 1.7.3
    :released: September 17, 2021

    .. change::
        :tags: bug, mypy
        :tickets: 914

        Fixed type annotations for the "constraint_name" argument of operations
        ``create_primary_key()``, ``create_foreign_key()``.  Pull request courtesy
        TilmanK.


.. changelog::
    :version: 1.7.2
    :released: September 17, 2021

    .. change::
        :tags: bug, typing
        :tickets: 900

        Added missing attributes from context stubs.

    .. change::
        :tags: bug, mypy
        :tickets: 897

        Fixed an import in one of the .pyi files that was triggering an
        assertion error in some versions of mypy.

    .. change::
        :tags: bug, regression, ops
        :tickets: 920

        Fixed issue where registration of custom ops was prone to failure due to
        the registration process running ``exec()`` on generated code that as of
        the 1.7 series includes pep-484 annotations, which in the case of end user
        code would result in name resolution errors when the exec occurs. The logic
        in question has been altered so that the annotations are rendered as
        forward references so that the ``exec()`` can proceed.

.. changelog::
    :version: 1.7.1
    :released: August 30, 2021

    .. change::
        :tags: bug, installation
        :tickets: 893

        Corrected "universal wheel" directive in setup.cfg so that building a wheel
        does not target Python 2. The PyPi files index for 1.7.0 was corrected
        manually. Pull request courtesy layday.

    .. change::
        :tags: bug, pep484
        :tickets: 895

        Fixed issue in generated .pyi files where default values for ``Optional``
        arguments were missing, thereby causing mypy to consider them as required.


    .. change::
        :tags: bug, regression, batch
        :tickets: 896

        Fixed regression in batch mode due to :ticket:`883` where the "auto" mode
        of batch would fail to accommodate any additional migration directives
        beyond encountering an ``add_column()`` directive, due to a mis-application
        of the conditional logic that was added as part of this change, leading to
        "recreate" mode not being used in cases where it is required for SQLite
        such as for unique constraints.

.. changelog::
    :version: 1.7.0
    :released: August 30, 2021

    .. change::
        :tags: bug, operations
        :tickets: 879

        Fixed regression due to :ticket:`803` where the ``.info`` and ``.comment``
        attributes of ``Table`` would be lost inside of the :class:`.DropTableOp`
        class, which when "reversed" into a :class:`.CreateTableOp` would then have
        lost these elements. Pull request courtesy Nicolas CANIART.


    .. change::
        :tags: feature, environment
        :tickets: 842

        Enhance ``version_locations`` parsing to handle paths containing spaces.
        The new configuration option ``version_path_separator`` specifies the
        character to use when splitting the ``version_locations`` string. The
        default for new configurations is ``version_path_separator = os``,
        which will use ``os.pathsep`` (e.g., ``;`` on Windows).

    .. change::
        :tags: installation, changed

        Alembic 1.7 now supports Python 3.6 and above; support for prior versions
        including Python 2.7 has been dropped.

    .. change::
        :tags: bug, sqlite, batch
        :tickets: 883

        Batch "auto" mode will now select for "recreate" if the ``add_column()``
        operation is used on SQLite, and the column itself meets the criteria for
        SQLite where ADD COLUMN is not allowed, in this case a functional or
        parenthesized SQL expression or a ``Computed`` (i.e. generated) column.

    .. change::
        :tags: changed, installation
        :tickets: 674

        Make the ``python-dateutil`` library an optional dependency.
        This library is only required if the ``timezone`` option
        is used in the Alembic configuration.
        An extra require named ``tz`` is available with
        ``pip install alembic[tz]`` to install it.

    .. change::
        :tags: bug, commands
        :tickets: 856

        Re-implemented the ``python-editor`` dependency as a small internal
        function to avoid the need for external dependencies.

    .. change::
        :tags: usecase, batch
        :tickets: 884

        Named CHECK constraints are now supported by batch mode, and will
        automatically be part of the recreated table assuming they are named. They
        also can be explicitly dropped using ``op.drop_constraint()``. For
        "unnamed" CHECK constraints, these are still skipped as they cannot be
        distinguished from the CHECK constraints that are generated by the
        ``Boolean`` and ``Enum`` datatypes.

        Note that this change may require adjustments to migrations that drop or
        rename columns which feature an associated named check constraint, such
        that an additional ``op.drop_constraint()`` directive should be added for
        that named constraint as there will no longer be an associated column
        for it; for the ``Boolean`` and ``Enum`` datatypes, an ``existing_type``
        keyword may be passed to ``BatchOperations.drop_constraint`` as well.

        .. seealso::

          :ref:`batch_schematype_constraints`

          :ref:`batch_check_constraints`


    .. change::
        :tags: changed, installation
        :tickets: 885

        The dependency on ``pkg_resources`` which is part of ``setuptools`` has
        been removed, so there is no longer any runtime dependency on
        ``setuptools``. The functionality has been replaced with
        ``importlib.metadata`` and ``importlib.resources`` which are both part of
        Python std.lib, or via pypy dependency ``importlib-metadata`` for Python
        version < 3.8 and ``importlib-resources`` for Python version < 3.9
        (while importlib.resources was added to Python in 3.7, it did not include
        the "files" API until 3.9).

    .. change::
        :tags: feature, tests
        :tickets: 855

        Created a "test suite" similar to the one for SQLAlchemy, allowing
        developers of third-party dialects to test their code against a set of
        Alembic tests that have been specially selected to exercise
        back-end database operations. At the time of release,
        third-party dialects that have adopted the Alembic test suite to verify
        compatibility include
        `CockroachDB <https://pypi.org/project/sqlalchemy-cockroachdb/>`_ and
        `SAP ASE (Sybase) <https://pypi.org/project/sqlalchemy-sybase/>`_.

    .. change::
       :tags: bug, postgresql
       :tickets: 874

       Fixed issue where usage of the PostgreSQL ``postgresql_include`` option
       within a :meth:`.Operations.create_index` would raise a KeyError, as the
       additional column(s) need to be added to the table object used by the
       construct internally. The issue is equivalent to the SQL Server issue fixed
       in :ticket:`513`. Pull request courtesy Steven Bronson.

    .. change::
        :tags: feature, general

        pep-484 type annotations have been added throughout the library.
        Additionally, stub .pyi files have been added for the "dynamically"
        generated Alembic modules ``alembic.op`` and ``alembic.config``, which
        include complete function signatures and docstrings, so that the functions
        in these namespaces will have both IDE support (vscode, pycharm, etc) as
        well as support for typing tools like Mypy. The files themselves are
        statically generated from their source functions within the source tree.

.. changelog::
    :version: 1.6.5
    :released: May 27, 2021

    .. change::
        :tags: bug, autogenerate
        :tickets: 849

        Fixed issue where dialect-specific keyword arguments within the
        :class:`.DropIndex` operation directive would not render in the
        autogenerated Python code. As support was improved for adding dialect
        specific arguments to directives as part of :ticket:`803`, in particular
        arguments such as "postgresql_concurrently" which apply to the actual
        create/drop of the index, support was needed for these to render even in a
        drop index operation. Pull request courtesy Jet Zhou.

.. changelog::
    :version: 1.6.4
    :released: May 24, 2021

    .. change::
        :tags: bug, regression, op directives
        :tickets: 848

        Fixed regression caused by just fixed :ticket:`844` that scaled back the
        filter for ``unique=True/index=True`` too far such that these directives no
        longer worked for the ``op.create_table()`` op, this has been fixed.

.. changelog::
    :version: 1.6.3
    :released: May 21, 2021

    .. change::
        :tags: bug, regression, autogenerate
        :tickets: 844

        Fixed 1.6-series regression where ``UniqueConstraint`` and to a lesser
        extent ``Index`` objects would be doubled up in the generated model when
        the ``unique=True`` / ``index=True`` flags were used.

    .. change::
        :tags: bug, autogenerate
        :tickets: 839

        Fixed a bug where paths defined in post-write hook options
        would be wrongly escaped in non posix environment (Windows).

    .. change::
        :tags: bug, regression, versioning
        :tickets: 843

        Fixed regression where a revision file that contained its own down revision
        as a dependency would cause an endless loop in the traversal logic.

.. changelog::
    :version: 1.6.2
    :released: May 6, 2021

    .. change::
        :tags: bug, versioning, regression
        :tickets: 839

        Fixed additional regression nearly the same as that of :ticket:`838` just
        released in 1.6.1 but within a slightly different codepath, where "alembic
        downgrade head" (or equivalent) would fail instead of iterating no
        revisions.

.. changelog::
    :version: 1.6.1
    :released: May 6, 2021

    .. change::
        :tags: bug, versioning, regression
        :tickets: 838

        Fixed regression in new revisioning traversal where "alembic downgrade
        base" would fail if the database itself were clean and unversioned;
        additionally repairs the case where downgrade would fail if attempting
        to downgrade to the current head that is already present.

.. changelog::
    :version: 1.6.0
    :released: May 3, 2021

    .. change::
        :tags: bug, autogenerate
        :tickets: 803

        Refactored the implementation of :class:`.MigrateOperation` constructs such
        as :class:`.CreateIndexOp`, :class:`.CreateTableOp`, etc. so that they no
        longer rely upon maintaining a persistent version of each schema object
        internally; instead, the state variables of each operation object will be
        used to produce the corresponding construct when the operation is invoked.
        The rationale is so that environments which make use of
        operation-manipulation schemes such as those those discussed in
        :ref:`autogen_rewriter` are better supported, allowing end-user code to
        manipulate the public attributes of these objects which will then be
        expressed in the final output, an example is
        ``some_create_index_op.kw["postgresql_concurrently"] = True``.

        Previously, these objects when generated from autogenerate would typically
        hold onto the original, reflected element internally without honoring the
        other state variables of each construct, preventing the public API from
        working.



    .. change::
        :tags: bug, environment
        :tickets: 829

        Fixed regression caused by the SQLAlchemy 1.4/2.0 compatibility switch
        where calling ``.rollback()`` or ``.commit()`` explicitly within the
        ``context.begin_transaction()`` context manager would cause it to fail when
        the block ended, as it did not expect that the transaction was manually
        closed.

    .. change::
        :tags: bug, autogenerate
        :tickets: 827

        Improved the rendering of ``op.add_column()`` operations when adding
        multiple columns to an existing table, so that the order of these
        statements matches the order in which the columns were declared in the
        application's table metadata. Previously the added columns were being
        sorted alphabetically.


    .. change::
        :tags: feature, autogenerate
        :tickets: 819

        Fix the documentation regarding the default command-line argument position of
        the revision script filename within the post-write hook arguments. Implement a
        ``REVISION_SCRIPT_FILENAME`` token, enabling the position to be changed. Switch
        from ``str.split()`` to ``shlex.split()`` for more robust command-line argument
        parsing.

    .. change::
        :tags: feature
        :tickets: 822

        Implement a ``.cwd`` (current working directory) suboption for post-write hooks
        (of type ``console_scripts``). This is useful for tools like pre-commit, which
        rely on the working directory to locate the necessary config files. Add
        pre-commit as an example to the documentation. Minor change: rename some variables
        from ticket #819 to improve readability.

    .. change::
        :tags: bug, versioning
        :tickets: 765, 464

        The algorithm used for calculating downgrades/upgrades/iterating
        revisions has been rewritten, to resolve ongoing issues of branches
        not being handled consistently particularly within downgrade operations,
        as well as for overall clarity and maintainability.  This change includes
        that a deprecation warning is emitted if an ambiguous command such
        as "downgrade -1" when multiple heads are present is given.

        In particular, the change implements a long-requested use case of allowing
        downgrades of a single branch to a branchpoint.

        Huge thanks to Simon Bowly for their impressive efforts in successfully
        tackling this very difficult problem.

    .. change::
        :tags: bug, batch
        :tickets: 799

        Added missing ``batch_op.create_table_comment()``,
        ``batch_op.drop_table_comment()`` directives to batch ops.

.. changelog::
    :version: 1.5.8
    :released: March 23, 2021

    .. change::
        :tags: bug, environment
        :tickets: 816

        Fixed regression caused by SQLAlchemy 1.4 where the "alembic current"
        command would fail due to changes in the ``URL`` object.


.. changelog::
    :version: 1.5.7
    :released: March 11, 2021

    .. change::
        :tags: bug, autogenerate
        :tickets: 813

        Adjusted the recently added
        :paramref:`.EnvironmentContext.configure.include_name` hook to accommodate
        for additional object types such as "views" that don't have a parent table,
        to support third party recipes and extensions. Pull request courtesy Oliver
        Rice.

.. changelog::
    :version: 1.5.6
    :released: March 5, 2021

    .. change::
        :tags: bug, mssql, operations
        :tickets: 812

        Fixed bug where the "existing_type" parameter, which the MSSQL dialect
        requires in order to change the nullability of a column in the absence of
        also changing the column type, would cause an ALTER COLUMN operation to
        incorrectly render a second ALTER statement without the nullability if a
        new type were also present, as the MSSQL-specific contract did not
        anticipate all three of "nullability", ``"type_"`` and "existing_type" being
        sent at the same time.


    .. change::
        :tags: template
        :ticket: 805

        Add async template to Alembic to bootstrap environments that use
        async DBAPI. Updated the cookbook to include a migration guide
        on how to adapt an existing environment for use with DBAPI drivers.

.. changelog::
    :version: 1.5.5
    :released: February 20, 2021

    .. change::
        :tags: bug

        Adjusted the use of SQLAlchemy's ".copy()" internals to use "._copy()"
        for version 1.4.0, as this method is being renamed.

    .. change::
        :tags: bug, environment
        :tickets: 797

        Added new config file option ``prepend_sys_path``, which is a series of
        paths that will be prepended to sys.path; the default value in newly
        generated alembic.ini files is ".".  This fixes a long-standing issue
        where for some reason running the alembic command line would not place the
        local "." path in sys.path, meaning an application locally present in "."
        and importable through normal channels, e.g. python interpreter, pytest,
        etc. would not be located by Alembic, even though the ``env.py`` file is
        loaded relative to the current path when ``alembic.ini`` contains a
        relative path. To enable for existing installations, add the option to the
        alembic.ini file as follows::

          # sys.path path, will be prepended to sys.path if present.
          # defaults to the current working directory.
          prepend_sys_path = .

        .. seealso::

            :ref:`installation` - updated documentation reflecting that local
            installation of the project is not necessary if running the Alembic cli
            from the local path.


.. changelog::
    :version: 1.5.4
    :released: February 3, 2021

    .. change::
        :tags: bug, versioning
        :tickets: 789

        Fixed bug in versioning model where a downgrade across a revision with a
        dependency on another branch, yet an ancestor is also dependent on that
        branch, would produce an erroneous state in the alembic_version table,
        making upgrades impossible without manually repairing the table.

.. changelog::
    :version: 1.5.3
    :released: January 29, 2021

    .. change::
        :tags: bug, autogenerate
        :tickets: 786

        Changed the default ordering of "CREATE" and "DROP" statements indexes and
        unique constraints within the autogenerate process, so that for example in
        an upgrade() operation, a particular index or constraint that is to be
        replaced such as for a casing convention change will not produce any naming
        conflicts. For foreign key constraint objects, this is already how
        constraints are ordered, and for table objects, users would normally want
        to use :meth:`.Operations.rename_table` in any case.

    .. change::
        :tags: bug, autogenerate, mssql
        :tickets: 787

        Fixed assorted autogenerate issues with SQL Server:

        * ignore default reflected identity on primary_key columns
        * improve server default comparison

    .. change::
        :tags: bug, mysql, autogenerate
        :tickets: 788

        Fixed issue where autogenerate rendering of ``op.alter_column()`` would
        fail to include MySQL ``existing_nullable=False`` if the column were part
        of a primary key constraint within the table metadata.

.. changelog::
    :version: 1.5.2
    :released: January 20, 2021

    .. change::
        :tags: bug, versioning, regression
        :tickets: 784

        Fixed regression where new "loop detection" feature introduced in
        :ticket:`757` produced false positives for revision names that have
        overlapping substrings between revision number and down revision and/or
        dependency, if the downrev/dependency were not in sequence form.

    .. change::
        :tags: bug, environment
        :tickets: 782

        Fixed regression where Alembic would fail to create a transaction properly
        if the :class:`sqlalchemy.engine.Connection` were a so-called "branched"
        connection, that is, one where the ``.connect()`` method had been called to
        create a "sub" connection.

.. changelog::
    :version: 1.5.1
    :released: January 19, 2021

    .. change::
        :tags: bug, installation, commands
        :tickets: 780

        Fixed installation issue where the "templates" directory was not being
        installed, preventing commands like "list_templates" and "init" from
        working.

.. changelog::
    :version: 1.5.0
    :released: January 18, 2021

    .. change::
        :tags: usecase, operations
        :tickets: 730

        Added support for rendering of "identity" elements on
        :class:`.Column` objects, supported in SQLAlchemy via
        the :class:`.Identity` element introduced in version 1.4.

        Adding columns with identity is supported on PostgreSQL,
        MSSQL and Oracle. Changing the identity options or removing
        it is supported only on PostgreSQL and Oracle.

    .. change::
        :tags: changed, environment

        To accommodate SQLAlchemy 1.4 and 2.0, the migration model now no longer
        assumes that the SQLAlchemy Connection will autocommit an individual
        operation.   This essentially means that for databases that use
        non-transactional DDL (pysqlite current driver behavior, MySQL), there is
        still a BEGIN/COMMIT block that will surround each individual migration.
        Databases that support transactional DDL should continue to have the
        same flow, either per migration or per-entire run, depending on the
        value of the :paramref:`.Environment.configure.transaction_per_migration`
        flag.


    .. change::
        :tags: changed, environment

        A :class:`.CommandError` is raised if a ``sqlalchemy.engine.Engine`` is
        passed to the :meth:`.MigrationContext.configure` method instead of a
        ``sqlalchemy.engine.Connection`` object.  Previously, this would be a
        warning only.

    .. change::
        :tags: bug, operations
        :tickets: 753

        Modified the ``add_column()`` operation such that the ``Column`` object in
        use is shallow copied to a new instance if that ``Column`` is already
        attached to a ``table()`` or ``Table``. This accommodates for the change
        made in SQLAlchemy issue #5618 which prohibits a ``Column`` from being
        associated with multiple ``table()`` objects. This resumes support for
        using a ``Column`` inside of an Alembic operation that already refers to a
        parent ``table()`` or ``Table`` as well as allows operation objects just
        autogenerated to work.

    .. change::
        :tags: feature, autogenerate
        :tickets: 650

        Added new hook :paramref:`.EnvironmentContext.configure.include_name`,
        which complements the
        :paramref:`.EnvironmentContext.configure.include_object` hook by providing
        a means of preventing objects of a certain name from being autogenerated
        **before** the SQLAlchemy reflection process takes place, and notably
        includes explicit support for passing each schema name when
        :paramref:`.EnvironmentContext.configure.include_schemas` is set to True.
        This is most important especially for environments that make use of
        :paramref:`.EnvironmentContext.configure.include_schemas` where schemas are
        actually databases (e.g. MySQL) in order to prevent reflection sweeps of
        the entire server.

        .. seealso::

            :ref:`autogenerate_include_hooks` - new documentation section

    .. change::
        :tags: removed, autogenerate

        The long deprecated
        :paramref:`.EnvironmentContext.configure.include_symbol` hook is removed.
        The  :paramref:`.EnvironmentContext.configure.include_object`
        and  :paramref:`.EnvironmentContext.configure.include_name`
        hooks both achieve the goals of this hook.


    .. change::
        :tags: bug, autogenerate
        :tickets: 721

        Added rendering for the ``Table.prefixes`` element to autogenerate so that
        the rendered Python code includes these directives. Pull request courtesy
        Rodrigo Ce Moretto.

    .. change::
        :tags: bug, batch
        :tickets: 761

        Added missing "create comment" feature for columns that are altered in
        batch migrations.


    .. change::
        :tags: changed
        :tickets: 748

        Alembic 1.5.0 now supports **Python 2.7 and Python 3.6 and above**, as well
        as **SQLAlchemy 1.3.0 and above**.  Support is removed for Python 3
        versions prior to 3.6 and SQLAlchemy versions prior to the 1.3 series.

    .. change::
        :tags: bug, batch
        :tickets: 773

        Made an adjustment to the PostgreSQL dialect to allow it to work more
        effectively in batch mode, where a datatype like Boolean or non-native Enum
        that may have embedded rules to generate CHECK constraints will be more
        correctly handled in that these constraints usually will not have been
        generated on the PostgreSQL backend; previously it would inadvertently
        assume they existed unconditionally in a special PG-only "drop constraint"
        step.


    .. change::
        :tags: feature, versioning
        :tickets: 757

        The revision tree is now checked for cycles and loops between revision
        files when the revision environment is loaded up.  Scenarios such as a
        revision pointing to itself, or a revision that can reach itself via a
        loop, are handled and will raise the :class:`.CycleDetected` exception when
        the environment is loaded (expressed from the Alembic commandline as a
        failure message and nonzero return code). Previously, these situations were
        silently ignored up front, and the behavior of revision traversal would
        either be silently incorrect, or would produce errors such as
        :class:`.RangeNotAncestorError`.  Pull request courtesy Koichiro Den.


    .. change::
        :tags: usecase, commands

        Add ``__main__.py`` file to alembic package to support invocation
        with ``python -m alembic``.

    .. change::
        :tags: removed, commands

        Removed deprecated ``--head_only`` option to the ``alembic current``
        command

    .. change::
        :tags: removed, operations

        Removed legacy parameter names from operations, these have been emitting
        warnings since version 0.8.  In the case that legacy version files have not
        yet been updated, these can be modified directly in order to maintain
        compatibility:

        * :meth:`.Operations.drop_constraint` - "type" (use ``"type_"``) and "name"
          (use "constraint_name")

        * :meth:`.Operations.create_primary_key` - "cols" (use "columns") and
          "name" (use "constraint_name")

        * :meth:`.Operations.create_unique_constraint` - "name" (use
          "constraint_name"), "source" (use "table_name") and "local_cols" (use
          "columns")

        * :meth:`.Operations.batch_create_unique_constraint` - "name" (use
          "constraint_name")

        * :meth:`.Operations.create_foreign_key` - "name" (use "constraint_name"),
          "source" (use "source_table"), "referent" (use "referent_table")

        * :meth:`.Operations.batch_create_foreign_key` - "name" (use
          "constraint_name"), "referent" (use "referent_table")

        * :meth:`.Operations.create_check_constraint` - "name" (use
          "constraint_name"), "source" (use "table_name")

        * :meth:`.Operations.batch_create_check_constraint` - "name" (use
          "constraint_name")

        * :meth:`.Operations.create_index` - "name" (use "index_name")

        * :meth:`.Operations.drop_index` - "name" (use "index_name"), "tablename"
          (use "table_name")

        * :meth:`.Operations.batch_drop_index` - "name" (use "index_name"),

        * :meth:`.Operations.create_table` - "name" (use "table_name")

        * :meth:`.Operations.drop_table` - "name" (use "table_name")

        * :meth:`.Operations.alter_column` - "name" (use "new_column_name")



.. changelog::
    :version: 1.4.3
    :released: September 11, 2020

    .. change::
        :tags: bug, sqlite, batch
        :tickets: 711

        Added support to drop named CHECK constraints that are specified as part of
        a column, rather than table wide.  Previously, only constraints associated
        with the table were considered.

    .. change::
        :tags: bug, ops, mysql
        :tickets: 736

        Fixed issue where the MySQL dialect would not correctly render the server
        default of a column in an alter operation, if the operation were
        programmatically generated from an autogenerate pass as it would not
        accommodate for the full structure of the DefaultClause construct.

    .. change::
        :tags: bug, sqlite, batch
        :tickets: 697

        Fixed issue where the CAST applied to a JSON column when copying a SQLite
        table during batch mode would cause the data to be lost, as SQLite's CAST
        with JSON appears to convert the data to the value "0". The CAST is now
        skipped in a dialect-specific manner, including for JSON columns on SQLite.
        Pull request courtesy Sebastián Ramírez.

    .. change::
        :tags: bug, commands
        :tickets: 694

        The ``alembic current`` command no longer creates an ``alembic_version``
        table in the database if one does not exist already, returning no version
        as the current version. This allows checking for migrations in parallel
        without introducing race conditions.  Pull request courtesy Nikolay
        Edigaryev.


    .. change::
        :tags: bug, batch

        Fixed issue where columns in a foreign-key referenced table would be
        replaced with null-type columns during a batch operation; while this did
        not generally have any side effects, it could theoretically impact a batch
        operation that also targets that table directly and also would interfere
        with future changes to the ``.append_column()`` method to disallow implicit
        replacement of columns.

    .. change::
       :tags: bug, mssql
       :tickets: 716

       Fixed issue where the ``mssql_drop_foreign_key=True`` flag on
       ``op.drop_column`` would lead to incorrect syntax error due to a typo in the
       SQL emitted, same typo was present in the test as well so it was not
       detected. Pull request courtesy Oleg Shigorin.

.. changelog::
    :version: 1.4.2
    :released: March 19, 2020

    .. change::
        :tags: usecase, autogenerate
        :tickets: 669

        Adjusted autogen comparison to accommodate for backends that support
        computed column reflection, dependent on SQLAlchemy version 1.3.16 or
        higher. This emits a warning if the SQL expression inside of a
        :class:`.Computed` value changes between the metadata and the database, as
        these expressions can't be changed without dropping and recreating the
        column.


    .. change::
        :tags: bug, tests
        :tickets: 668

        Fixed an issue that prevented the test suite from running with the
        recently released py.test 5.4.0.


    .. change::
        :tags: bug, autogenerate, mysql
        :tickets: 671

        Fixed more false-positive failures produced by the new "compare type" logic
        first added in :ticket:`605`, particularly impacting MySQL string types
        regarding flags such as "charset" and "collation".

    .. change::
        :tags: bug, op directives, oracle
        :tickets: 670

        Fixed issue in Oracle backend where a table RENAME with a schema-qualified
        name would include the schema in the "to" portion, which is rejected by
        Oracle.


.. changelog::
    :version: 1.4.1
    :released: March 1, 2020

    .. change::
        :tags: bug, autogenerate
        :tickets: 661

        Fixed regression caused by the new "type comparison" logic introduced in
        1.4 as part of :ticket:`605` where comparisons of MySQL "unsigned integer"
        datatypes would produce false positives, as the regular expression logic
        was not correctly parsing the "unsigned" token when MySQL's default display
        width would be returned by the database.  Pull request courtesy Paul
        Becotte.

    .. change::
        :tags: bug, environment
        :tickets: 663

        Error message for "path doesn't exist" when loading up script environment
        now displays the absolute path.  Pull request courtesy Rowan Hart.

    .. change::
        :tags: bug, autogenerate
        :tickets: 654

        Fixed regression in 1.4.0 due to :ticket:`647` where unique constraint
        comparison with mixed case constraint names while not using a naming
        convention would produce false positives during autogenerate.

    .. change::
        :tags: bug, environment

        The check for matched rowcount when the alembic_version table is updated or
        deleted from is now conditional based on whether or not the dialect
        supports the concept of "rowcount" for UPDATE or DELETE rows matched.  Some
        third party dialects do not support this concept.  Pull request courtesy Ke
        Zhu.

    .. change::
        :tags: bug, operations
        :tickets: 655

        Fixed long-standing bug where an inline column CHECK constraint would not
        be rendered within an "ADD COLUMN" operation.  The DDL compiler is now
        consulted for inline constraints within the :meth:`.Operations.add_column`
        method as is done for regular CREATE TABLE operations.



.. changelog::
    :version: 1.4.0
    :released: February 4, 2020

    .. change::
        :tags: change

        The internal inspection routines no longer use SQLAlchemy's
        ``Inspector.from_engine()`` method, which is expected to be deprecated in
        1.4.  The ``inspect()`` function is now used.


    .. change::
        :tags: bug, autogenerate
        :tickets: 647

        Adjusted the unique constraint comparison logic in a similar manner as that
        of :ticket:`421` did for indexes in order to take into account SQLAlchemy's
        own truncation of long constraint names when a naming convention is in use.
        Without this step, a name that is truncated by SQLAlchemy based on a unique
        constraint naming convention or hardcoded name will not compare properly.


    .. change::
        :tags: feature, batch
        :tickets: 640

        Added new parameters :paramref:`.BatchOperations.add_column.insert_before`,
        :paramref:`.BatchOperations.add_column.insert_after` which provide for
        establishing the specific position in which a new column should be placed.
        Also added :paramref:`.Operations.batch_alter_table.partial_reordering`
        which allows the complete set of columns to be reordered when the new table
        is created.   Both operations apply only to when batch mode is recreating
        the whole table using ``recreate="always"``.  Thanks to Marcin Szymanski
        for assistance with the implementation.

    .. change::
        :tags: usecase, environment
        :tickets: 648

        Moved the use of the ``__file__`` attribute at the base of the Alembic
        package into the one place that it is specifically needed, which is when
        the config attempts to locate the template directory. This helps to allow
        Alembic to be fully importable in environments that are using Python
        memory-only import schemes.  Pull request courtesy layday.

    .. change::
        :tags: bug, autogenerate
        :tickets: 605

        A major rework of the "type comparison" logic is in place which changes the
        entire approach by which column datatypes are compared.  Types are now
        compared based on the DDL string generated by the metadata type vs. the
        datatype reflected from the database.  This means we compare types based on
        what would actually render and additionally if elements of the types change
        like string length, those changes are detected as well.  False positives
        like those generated between SQLAlchemy Boolean and MySQL TINYINT should
        also be resolved.   Thanks very much to Paul Becotte  for lots of hard work
        and patience on this one.

        .. seealso::

            :ref:`autogenerate_detects` - updated comments on type comparison

.. changelog::
    :version: 1.3.3
    :released: January 22, 2020

    .. change::
        :tags: bug, postgresql
        :tickets: 637

        Fixed issue where COMMENT directives for PostgreSQL failed to correctly
        include an explicit schema name, as well as correct quoting rules for
        schema, table, and column names.  Pull request courtesy Matthew Sills.

    .. change::
        :tags: usecase, operations
        :tickets: 624

        Added support for rendering of "computed" elements on :class:`.Column`
        objects, supported in SQLAlchemy via the new :class:`.Computed` element
        introduced in version 1.3.11. Pull request courtesy Federico Caselli.

        Note that there is currently no support for ALTER COLUMN to add, remove, or
        modify the "GENERATED ALWAYS AS" element from a column;  at least for
        PostgreSQL, it does not seem to be supported by the database. Additionally,
        SQLAlchemy does not currently reliably reflect the "GENERATED ALWAYS AS"
        phrase from an existing column, so there is also no autogenerate support
        for addition or removal of the :class:`.Computed` element to or from an
        existing column, there is only support for adding new columns that include
        the :class:`.Computed` element.  In the case that the :class:`.Computed`
        element is removed from the :class:`.Column` object in the table metadata,
        PostgreSQL and Oracle currently reflect the "GENERATED ALWAYS AS"
        expression as the "server default" which will produce an op that tries to
        drop the element as a default.

.. changelog::
    :version: 1.3.2
    :released: December 16, 2019

    .. change::
        :tags: bug, api, autogenerate
        :tickets: 635

        Fixed regression introduced by :ticket:`579` where server default rendering
        functions began to require a dialect implementation, however the
        :func:`.render_python_code` convenience function did not include one, thus
        causing the function to fail when used in a server default context.  The
        function now accepts a migration context argument and also creates one
        against the default dialect if one is not provided.


.. changelog::
    :version: 1.3.1
    :released: November 13, 2019

    .. change::
        :tags: bug, mssql
        :tickets: 621

        Fixed bug in MSSQL dialect where the drop constraint execution steps used
        to remove server default or implicit foreign key constraint failed to take
        into account the schema name of the target table.


.. changelog::
    :version: 1.3.0
    :released: October 31, 2019

    .. change::
        :tags: feature, command
        :tickets: 608

        Added support for ALEMBIC_CONFIG environment variable,
        refers to the location of the alembic configuration script
        in lieu of using the -c command line option.


    .. change::
        :tags: bug, autogenerate
        :tickets: 131

        Fixed bug in new Variant autogenerate where the order of the arguments to
        Variant were mistakenly reversed.

    .. change::
        :tags: change, compatibility

        Some internal modifications have been made to how the names of indexes and
        unique constraints work to make use of new functions added in SQLAlchemy
        1.4, so that SQLAlchemy has more flexibility over how naming conventions
        may be applied to these objects.

.. changelog::
    :version: 1.2.1
    :released: September 24, 2019

    .. change::
        :tags: bug, command
        :tickets: 601

        Reverted the name change of the "revisions" argument to
        :func:`.command.stamp` to "revision" as apparently applications are
        calling upon this argument as a keyword name.  Pull request courtesy
        Thomas Bechtold.  Special translations are also added to the command
        line interface so that it is still known as "revisions" in the CLI.

    .. change::
        :tags: bug, tests
        :tickets: 592

        Removed the "test requirements" from "setup.py test", as this command now
        only emits a removal error in any case and these requirements are unused.

.. changelog::
    :version: 1.2.0
    :released: September 20, 2019

    .. change::
        :tags: feature, command
        :tickets: 473

        Added new ``--purge`` flag to the ``alembic stamp`` command, which will
        unconditionally erase the version table before stamping anything.  This is
        useful for development where non-existent version identifiers might be left
        within the table.  Additionally, ``alembic.stamp`` now supports a list of
        revision identifiers, which are intended to allow setting up muliple heads
        at once.  Overall handling of version identifiers within the
        ``alembic.stamp`` command has been improved with many new tests and
        use cases added.

    .. change::
        :tags: bug, autogenerate
        :tickets: 550

        Improved the Python rendering of a series of migration operations such that
        a single "pass" is rendered for a :class:`.UpgradeOps` or
        :class:`.DowngradeOps` based on if no lines of Python code actually
        rendered under the operation, rather than whether or not sub-directives
        exist. Removed extra "pass" lines that would generate from the
        :class:`.ModifyTableOps` directive so that these aren't duplicated under
        operation rewriting scenarios.


    .. change::
        :tags: feature, runtime
        :tickets: 123

        Added new feature :meth:`.MigrationContext.autocommit_block`, a special
        directive which will provide for a non-transactional block inside of a
        migration script. The feature requires that: the database driver
        (e.g. DBAPI) supports the AUTOCOMMIT isolation mode.  The directive
        also necessarily needs to COMMIT the existing transaction in progress
        in order to enter autocommit mode.

        .. seealso::

            :meth:`.MigrationContext.autocommit_block`

    .. change::
        :tags: change: py3k

        Python 3.4 support is dropped, as the upstream tooling (pip, mysqlclient)
        etc are already dropping support for Python 3.4, which itself is no longer
        maintained.

    .. change::
        :tags: usecase, autogenerate
        :tickets: 518

        Added autogenerate support for :class:`.Column` objects that have
        dialect-specific ``**kwargs``, support first added in SQLAlchemy 1.3.
        This includes SQLite "on conflict" as well as options used by some
        third party dialects.

    .. change::
        :tags: usecase, autogenerate
        :tickets: 131

        Added rendering for SQLAlchemy ``Variant`` datatypes, which render as the
        base type plus one or more ``.with_variant()`` method calls.


    .. change::
        :tags: usecase, commands
        :tickets: 534

        Made the command interface revision lookup behavior more strict in that an
        Alembic revision number is only resolved based on a partial match rules if
        it has at least four characters, to prevent simple typographical issues
        from inadvertently  running migrations.

     .. change::
        :tags: feature, commands
        :tickets: 307

        Added "post write hooks" to revision generation.  These allow custom logic
        to run after a revision Python script is generated, typically for the
        purpose of running code formatters such as "Black" or "autopep8", but may
        be used for any arbitrary post-render hook as well, including custom Python
        functions or scripts.  The hooks are enabled by providing a
        ``[post_write_hooks]`` section in the alembic.ini file.  A single hook
        is provided which runs an arbitrary Python executable on the newly
        generated revision script, which can be configured to run code formatters
        such as Black; full examples are included in the documentation.

        .. seealso::

            :ref:`post_write_hooks`


    .. change::
        :tags: feature, environment
        :tickets: 463

        Added new flag ``--package`` to ``alembic init``.  For environments where
        the Alembic migration files and such are within the package tree and
        importable as modules, this flag can be specified which will add the
        additional ``__init__.py`` files in the version location and the
        environment location.

    .. change::
        :tags: bug, autogenerate
        :tickets: 549

        Fixed bug where rendering of comment text for table-level comments  within
        :meth:`.Operations.create_table_comment` and
        :meth:`.Operations.drop_table_comment` was not properly quote-escaped
        within rendered Python code for autogenerate.

    .. change::
        :tags: bug, autogenerate
        :tickets: 505

        Modified the logic of the :class:`.Rewriter` object such that it keeps a
        memoization of which directives it has processed, so that it can ensure it
        processes a particular directive only once, and additionally fixed
        :class:`.Rewriter` so that it functions correctly for multiple-pass
        autogenerate schemes, such as the one illustrated in the "multidb"
        template.  By tracking which directives have been processed, a
        multiple-pass scheme which calls upon the :class:`.Rewriter` multiple times
        for the same structure as elements are added can work without running
        duplicate operations on the same elements more than once.

.. changelog::
    :version: 1.1.0
    :released: August 26, 2019

    .. change::
        :tags: change

        Alembic 1.1 bumps the minimum version of SQLAlchemy to 1.1.   As was the
        case before, Python requirements remain at Python 2.7, or in the 3.x series
        Python 3.4.

    .. change::
        :tags: change, internals

        The test suite for Alembic now makes use of SQLAlchemy's testing framework
        directly.  Previously, Alembic had its own version of this framework that
        was mostly copied from that of SQLAlchemy to enable testing with older
        SQLAlchemy versions.  The majority of this code is now removed so that both
        projects can leverage improvements from a common testing framework.

    .. change::
        :tags: bug, commands
        :tickets: 562

        Fixed bug where the double-percent logic applied to some dialects such as
        psycopg2 would be rendered in ``--sql`` mode, by allowing dialect options
        to be passed through to the dialect used to generate SQL and then providing
        ``paramstyle="named"`` so that percent signs need not be doubled.   For
        users having this issue, existing env.py scripts need to add
        ``dialect_opts={"paramstyle": "named"}`` to their offline
        context.configure().  See the ``alembic/templates/generic/env.py`` template
        for an example.

    .. change::
        :tags: bug, py3k

        Fixed use of the deprecated "imp" module, which is used to detect  pep3147
        availability as well as to locate .pyc files, which started  emitting
        deprecation warnings during the test suite.   The warnings were not being
        emitted earlier during the test suite, the change is possibly due to
        changes in py.test itself but this is not clear. The check for pep3147 is
        set to True for any Python version 3.5 or greater now and importlib is used
        when available.  Note that some dependencies such as distutils may still be
        emitting this warning. Tests are adjusted to accommodate for dependencies
        that emit the warning as well.


    .. change::
        :tags: bug, mysql
        :tickets: 594

        Fixed issue where emitting a change of column name for MySQL did not
        preserve the column comment, even if it were specified as existing_comment.


    .. change::
        :tags: bug, setup
        :tickets: 592

        Removed the "python setup.py test" feature in favor of a straight run of
        "tox".   Per Pypa / pytest developers, "setup.py" commands are in general
        headed towards deprecation in favor of tox.  The tox.ini script has been
        updated such that running "tox" with no arguments will perform a single run
        of the test suite against the default installed Python interpreter.

        .. seealso::

            https://github.com/pypa/setuptools/issues/1684

            https://github.com/pytest-dev/pytest/issues/5534

    .. change::
        :tags: usecase, commands
        :tickets: 571

        The "alembic init" command will now proceed if the target directory exists
        as long as it's still empty.  Previously, it would not proceed if the
        directory existed. The new behavior is modeled from what git does, to
        accommodate for container or other deployments where an Alembic target
        directory may need to be already mounted instead of being created with
        alembic init.  Pull request courtesy Aviskar KC.



.. changelog::
    :version: 1.0.11
    :released: June 25, 2019

    .. change::
        :tags: bug, sqlite, autogenerate, batch
        :tickets: 579

        SQLite server default reflection will ensure parenthesis are surrounding a
        column default expression that is detected as being a non-constant
        expression, such as a ``datetime()`` default, to accommodate for the
        requirement that SQL expressions have to be parenthesized when being sent
        as DDL.  Parenthesis are not added to constant expressions to allow for
        maximum cross-compatibility with other dialects and existing test suites
        (such as Alembic's), which necessarily entails scanning the expression to
        eliminate for constant numeric and string values. The logic is added to the
        two "reflection->DDL round trip" paths which are currently autogenerate and
        batch migration.  Within autogenerate, the logic is on the rendering side,
        whereas in batch the logic is installed as a column reflection hook.


    .. change::
        :tags: bug, sqlite, autogenerate
        :tickets: 579

        Improved SQLite server default comparison to accommodate for a ``text()``
        construct that added parenthesis directly vs. a construct that relied
        upon the SQLAlchemy SQLite dialect to render the parenthesis, as well
        as improved support for various forms of constant expressions such as
        values that are quoted vs. non-quoted.


    .. change::
        :tags: bug, autogenerate

        Fixed bug where the "literal_binds" flag was not being set when
        autogenerate would create a server default value, meaning server default
        comparisons would fail for functions that contained literal values.

    .. change::
       :tags: bug, mysql
       :tickets: 554

       Added support for MySQL "DROP CHECK", which is added as of MySQL 8.0.16,
       separate from MariaDB's "DROP CONSTRAINT" for CHECK constraints.  The MySQL
       Alembic implementation now checks for "MariaDB" in server_version_info to
       decide which one to use.



    .. change::
        :tags: bug, mysql, operations
        :tickets: 564

        Fixed issue where MySQL databases need to use CHANGE COLUMN when altering a
        server default of CURRENT_TIMESTAMP, NOW() and probably other functions
        that are only usable with DATETIME/TIMESTAMP columns.  While MariaDB
        supports both CHANGE and ALTER COLUMN in this case, MySQL databases only
        support CHANGE.  So the new logic is that if the server default change is
        against a DateTime-oriented column, the CHANGE format is used
        unconditionally, as in the vast majority of cases the server default is to
        be CURRENT_TIMESTAMP which may also be potentially bundled with an "ON
        UPDATE CURRENT_TIMESTAMP" directive, which SQLAlchemy does not currently
        support as a distinct field.  The fix addiionally improves the server
        default comparison logic when the "ON UPDATE" clause is present and
        there are parenthesis to be adjusted for as is the case on some MariaDB
        versions.



    .. change::
        :tags: bug, environment

        Warnings emitted by Alembic now include a default stack level of 2, and in
        some cases it's set to 3, in order to help warnings indicate more closely
        where they are originating from.  Pull request courtesy Ash Berlin-Taylor.


    .. change::
        :tags: bug, py3k
        :tickets: 563

        Replaced the Python compatibility routines for ``getargspec()`` with a fully
        vendored version based on ``getfullargspec()`` from Python 3.3.
        Originally, Python was emitting deprecation warnings for this function in
        Python 3.8 alphas.  While this change was reverted, it was observed that
        Python 3 implementations for ``getfullargspec()`` are an order of magnitude
        slower as of the 3.4 series where it was rewritten against ``Signature``.
        While Python plans to improve upon this situation, SQLAlchemy projects for
        now are using a simple replacement to avoid any future issues.


.. changelog::
    :version: 1.0.10
    :released: April 28, 2019

    .. change::
       :tags: bug, commands
       :tickets: 552

       Fixed bug introduced in release 0.9.0 where the helptext for commands
       inadvertently got expanded to include function docstrings from the
       command.py module.  The logic has been adjusted to only refer to the first
       line(s) preceding the first line break within each docstring, as was the
       original intent.

    .. change::
        :tags: bug, operations, mysql
        :tickets: 551

        Added an assertion in :meth:`.RevisionMap.get_revisions` and other methods
        which ensures revision numbers are passed as strings or collections of
        strings.   Driver issues particularly on MySQL may inadvertently be passing
        bytes here which leads to failures later on.

    .. change::
        :tags: bug, autogenerate, mysql
        :tickets: 553

        Fixed bug when using the
        :paramref:`.EnvironmentContext.configure.compare_server_default` flag set
        to ``True`` where a server default that is introduced in the table metadata
        on an ``Integer`` column, where there is no existing server default in the
        database, would raise a ``TypeError``.

.. changelog::
    :version: 1.0.9
    :released: April 15, 2019

    .. change::
       :tags: bug, operations
       :tickets: 548

       Simplified the internal scheme used to generate the ``alembic.op`` namespace
       to no longer attempt to generate full method signatures (e.g. rather than
       generic ``*args, **kw``) as this was not working in most cases anyway, while
       in rare circumstances it would in fact sporadically have access to the real
       argument names and then fail when generating the function due to missing
       symbols in the argument signature.

.. changelog::
    :version: 1.0.8
    :released: March 4, 2019

    .. change::
       :tags: bug, operations
       :tickets: 528

       Removed use of deprecated ``force`` parameter for SQLAlchemy quoting
       functions as this parameter will be removed in a future release.
       Pull request courtesy Parth Shandilya(ParthS007).

    .. change::
       :tags: bug, autogenerate, postgresql, py3k
       :tickets: 541

       Fixed issue where server default comparison on the PostgreSQL dialect would
       fail for a blank string on Python 3.7 only, due to a change in regular
       expression behavior in Python 3.7.


.. changelog::
    :version: 1.0.7
    :released: January 25, 2019

    .. change::
       :tags: bug, autogenerate
       :tickets: 529

       Fixed issue in new comment support where autogenerated Python code
       for comments wasn't using ``repr()`` thus causing issues with
       quoting.  Pull request courtesy Damien Garaud.

.. changelog::
    :version: 1.0.6
    :released: January 13, 2019

    .. change::
        :tags: feature, operations
        :tickets: 422

        Added Table and Column level comments for supported backends.
        New methods :meth:`.Operations.create_table_comment` and
        :meth:`.Operations.drop_table_comment` are added.  A new arguments
        :paramref:`.Operations.alter_column.comment` and
        :paramref:`.Operations.alter_column.existing_comment` are added to
        :meth:`.Operations.alter_column`.   Autogenerate support is also added
        to ensure comment add/drops from tables and columns are generated as well
        as that :meth:`.Operations.create_table`, :meth:`.Operations.add_column`
        both include the comment field from the source :class:`.Table`
        or :class:`.Column` object.

.. changelog::
    :version: 1.0.5
    :released: November 27, 2018

    .. change::
        :tags: bug, py3k
        :tickets: 507

        Resolved remaining Python 3 deprecation warnings, covering
        the use of inspect.formatargspec() with a vendored version
        copied from the Python standard library, importing
        collections.abc above Python 3.3 when testing against abstract
        base classes, fixed one occurrence of log.warn(), as well as a few
        invalid escape sequences.

.. changelog::
    :version: 1.0.4
    :released: November 27, 2018

    .. change::
       :tags: change

       Code hosting has been moved to GitHub, at
       https://github.com/sqlalchemy/alembic.  Additionally, the
       main Alembic website documentation URL is now
       https://alembic.sqlalchemy.org.

.. changelog::
    :version: 1.0.3
    :released: November 14, 2018

    .. change::
        :tags: bug, mssql
        :tickets: 516

       Fixed regression caused by :ticket:`513`, where the logic to consume
       ``mssql_include`` was not correctly interpreting the case where the flag
       was not present, breaking the ``op.create_index`` directive for SQL Server
       as a whole.

.. changelog::
    :version: 1.0.2
    :released: October 31, 2018

    .. change::
       :tags: bug, autogenerate
       :tickets: 515

       The ``system=True`` flag on :class:`.Column`, used primarily in conjunction
       with the Postgresql "xmin" column, now renders within the autogenerate
       render process, allowing the column to be excluded from DDL.  Additionally,
       adding a system=True column to a model will produce no autogenerate diff as
       this column is implicitly present in the database.

    .. change::
       :tags: bug, mssql
       :tickets: 513

       Fixed issue where usage of the SQL Server ``mssql_include`` option within a
       :meth:`.Operations.create_index` would raise a KeyError, as the additional
       column(s) need to be added to the table object used by the construct
       internally.

.. changelog::
    :version: 1.0.1
    :released: October 17, 2018

    .. change::
        :tags: bug, commands
        :tickets: 497

        Fixed an issue where revision descriptions were essentially
        being formatted twice. Any revision description that contained
        characters like %, writing output to stdout will fail because
        the call to config.print_stdout attempted to format any
        additional args passed to the function.
        This fix now only applies string formatting if any args are provided
        along with the output text.

    .. change::
       :tags: bug, autogenerate
       :tickets: 512

       Fixed issue where removed method ``union_update()`` was used when a
       customized :class:`.MigrationScript` instance included entries in the
       ``.imports`` data member, raising an AttributeError.


.. changelog::
    :version: 1.0.0
    :released: July 13, 2018
    :released: July 13, 2018
    :released: July 13, 2018

    .. change::
        :tags: feature, general
        :tickets: 491

        For Alembic 1.0, Python 2.6 / 3.3 support is being dropped, allowing a
        fixed setup.py to be built as well as universal wheels.  Pull request
        courtesy Hugo.




    .. change::
        :tags: feature, general

        With the 1.0 release, Alembic's minimum SQLAlchemy support version
        moves to 0.9.0, previously 0.7.9.

    .. change::
        :tags: bug, batch
        :tickets: 502

        Fixed issue in batch where dropping a primary key column, then adding it
        back under the same name but without the primary_key flag, would not remove
        it from the existing PrimaryKeyConstraint.  If a new PrimaryKeyConstraint
        is added, it is used as-is, as was the case before.

.. changelog::
    :version: 0.9.10
    :released: June 29, 2018

    .. change::
        :tags: bug, autogenerate

        The "op.drop_constraint()" directive will now render using ``repr()`` for
        the schema name, in the same way that "schema" renders for all the other op
        directives.  Pull request courtesy Denis Kataev.

    .. change::
        :tags: bug, autogenerate
        :tickets: 494

        Added basic capabilities for external dialects to support rendering of
        "nested" types, like arrays, in a manner similar to that of the Postgresql
        dialect.

    .. change::
        :tags: bug, autogenerate

        Fixed issue where "autoincrement=True" would not render for a column that
        specified it, since as of SQLAlchemy 1.1 this is no longer the default
        value for "autoincrement".  Note the behavior only takes effect against the
        SQLAlchemy 1.1.0 and higher; for pre-1.1 SQLAlchemy, "autoincrement=True"
        does not render as was the case before. Pull request courtesy  Elad Almos.

.. changelog::
    :version: 0.9.9
    :released: March 22, 2018

    .. change::
        :tags: feature, commands
        :tickets: 481

        Added new flag ``--indicate-current`` to the ``alembic history`` command.
        When listing versions, it will include the token "(current)" to indicate
        the given version is a current head in the target database.  Pull request
        courtesy Kazutaka Mise.

    .. change::
        :tags: bug, autogenerate, mysql
        :tickets: 455

        The fix for :ticket:`455` in version 0.9.6 involving MySQL server default
        comparison was entirely non functional, as the test itself was also broken
        and didn't reveal that it wasn't working. The regular expression to compare
        server default values like CURRENT_TIMESTAMP to current_timestamp() is
        repaired.

    .. change::
        :tags: bug, mysql, autogenerate
        :tickets: 483

        Fixed bug where MySQL server default comparisons were basically not working
        at all due to incorrect regexp added in :ticket:`455`.  Also accommodates
        for MariaDB 10.2 quoting differences in reporting integer based server
        defaults.




    .. change::
        :tags: bug, operations, mysql
        :tickets: 487

        Fixed bug in ``op.drop_constraint()`` for MySQL where
        quoting rules would not be applied to the constraint name.

.. changelog::
    :version: 0.9.8
    :released: February 16, 2018

    .. change::
        :tags: bug, runtime
        :tickets: 482

        Fixed bug where the :meth:`.Script.as_revision_number` method
        did not accommodate for the 'heads' identifier, which in turn
        caused the :meth:`.EnvironmentContext.get_head_revisions`
        and :meth:`.EnvironmentContext.get_revision_argument` methods
        to be not usable when multiple heads were present.
        The :meth:.`EnvironmentContext.get_head_revisions` method returns
        a tuple in all cases as documented.



    .. change::
        :tags: bug, postgresql, autogenerate
        :tickets: 478

        Fixed bug where autogenerate of :class:`.ExcludeConstraint`
        would render a raw quoted name for a Column that has case-sensitive
        characters, which when invoked as an inline member of the Table
        would produce a stack trace that the quoted name is not found.
        An incoming Column object is now rendered as ``sa.column('name')``.

    .. change::
        :tags: bug, autogenerate
        :tickets: 468

        Fixed bug where the indexes would not be included in a
        migration that was dropping the owning table.   The fix
        now will also emit DROP INDEX for the indexes ahead of time,
        but more importantly will include CREATE INDEX in the
        downgrade migration.

    .. change::
        :tags: bug, postgresql
        :tickets: 480

        Fixed the autogenerate of the module prefix
        when rendering the text_type parameter of
        postgresql.HSTORE, in much the same way that
        we do for ARRAY's type and JSON's text_type.

    .. change::
        :tags: bug, mysql
        :tickets: 479

        Added support for DROP CONSTRAINT to the MySQL Alembic
        dialect to support MariaDB 10.2 which now has real
        CHECK constraints.  Note this change does **not**
        add autogenerate support, only support for op.drop_constraint()
        to work.

.. changelog::
    :version: 0.9.7
    :released: January 16, 2018

    .. change::
        :tags: bug, autogenerate
        :tickets: 472

        Fixed regression caused by :ticket:`421` which would
        cause case-sensitive quoting rules to interfere with the
        comparison logic for index names, thus causing indexes to show
        as added for indexes that have case-sensitive names.   Works with
        SQLAlchemy 0.9 and later series.


    .. change::
        :tags: bug, postgresql, autogenerate
        :tickets: 461

        Fixed bug where autogenerate would produce a DROP statement for the index
        implicitly created by a Postgresql EXCLUDE constraint, rather than skipping
        it as is the case for indexes implicitly generated by unique constraints.
        Makes use of SQLAlchemy 1.0.x's improved "duplicates index" metadata and
        requires at least SQLAlchemy version 1.0.x to function correctly.



.. changelog::
    :version: 0.9.6
    :released: October 13, 2017

    .. change::
        :tags: bug, commands
        :tickets: 458

        Fixed a few Python3.6 deprecation warnings by replacing ``StopIteration``
        with ``return``, as well as using ``getfullargspec()`` instead of
        ``getargspec()`` under Python 3.

    .. change::
        :tags: bug, commands
        :tickets: 441

        An addition to :ticket:`441` fixed in 0.9.5, we forgot to also filter
        for the ``+`` sign in migration names which also breaks due to the relative
        migrations feature.

    .. change::
        :tags: bug, autogenerate
        :tickets: 442

        Fixed bug expanding upon the fix for
        :ticket:`85` which adds the correct module import to the
        "inner" type for an ``ARRAY`` type, the fix now accommodates for the
        generic ``sqlalchemy.types.ARRAY`` type added in SQLAlchemy 1.1,
        rendering the inner type correctly regardless of whether or not the
        Postgresql dialect is present.

    .. change::
        :tags: bug, mysql
        :tickets: 455

        Fixed bug where server default comparison of CURRENT_TIMESTAMP would fail
        on MariaDB 10.2 due to a change in how the function is
        represented by the database during reflection.

    .. change::
        :tags: bug, autogenerate

        Fixed bug where comparison of ``Numeric`` types would produce
        a difference if the Python-side ``Numeric`` inadvertently specified
        a non-None "scale" with a "precision" of None, even though this ``Numeric``
        type will pass over the "scale" argument when rendering. Pull request
        courtesy Ivan Mmelnychuk.

    .. change::
        :tags: feature, commands
        :tickets: 447

        The ``alembic history`` command will now make use of the revision
        environment ``env.py`` unconditionally if the ``revision_environment``
        configuration flag is set to True.  Previously, the environment would
        only be invoked if the history specification were against a database-stored
        revision token.

    .. change::
        :tags: bug, batch
        :tickets: 457

        The name of the temporary table in batch mode is now generated
        off of the original table name itself, to avoid conflicts for the
        unusual case of multiple batch operations running against the same
        database schema at the same time.

    .. change::
        :tags: bug, autogenerate
        :tickets: 456

        A :class:`.ForeignKeyConstraint` can now render correctly if the
        ``link_to_name`` flag is set, as it will not attempt to resolve the name
        from a "key" in this case.  Additionally, the constraint will render
        as-is even if the remote column name isn't present on the referenced
        remote table.

    .. change::
        :tags: bug, runtime, py3k
        :tickets: 449

        Reworked "sourceless" system to be fully capable of handling any
        combination of: Python2/3x, pep3149 or not, PYTHONOPTIMIZE or not,
        for locating and loading both env.py files as well as versioning files.
        This includes: locating files inside of ``__pycache__`` as well as listing
        out version files that might be only in ``versions/__pycache__``, deduplicating
        version files that may be in ``versions/__pycache__`` and ``versions/``
        at the same time, correctly looking for .pyc or .pyo files based on
        if pep488 is present or not. The latest Python3x deprecation warnings
        involving importlib are also corrected.

.. changelog::
    :version: 0.9.5
    :released: August 9, 2017

    .. change::
        :tags: bug, commands
        :tickets: 441

        A :class:`.CommandError` is raised if the "--rev-id" passed to the
        :func:`.revision` command contains dashes or at-signs, as this interferes
        with the command notation used to locate revisions.

    .. change::
        :tags: bug, postgresql
        :tickets: 424

        Added support for the dialect-specific keyword arguments
        to :meth:`.Operations.drop_index`.   This includes support for
        ``postgresql_concurrently`` and others.

    .. change::
        :tags: bug, commands

        Fixed bug in timezone feature introduced in
        :ticket:`425` when the creation
        date in a revision file is calculated, to
        accommodate for timezone names that contain
        mixed-case characters in their name as opposed
        to all uppercase.  Pull request courtesy Nils
        Philippsen.

.. changelog::
    :version: 0.9.4
    :released: July 31, 2017

    .. change::
      :tags: bug, runtime

      Added an additional attribute to the new
      :paramref:`.EnvironmentContext.configure.on_version_apply` API,
      :attr:`.MigrationInfo.up_revision_ids`, to accommodate for the uncommon
      case of the ``alembic stamp`` command being used to move from multiple
      branches down to a common branchpoint; there will be multiple
      "up" revisions in this one case.

.. changelog::
    :version: 0.9.3
    :released: July 6, 2017

    .. change::
      :tags: feature, runtime

      Added a new callback hook
      :paramref:`.EnvironmentContext.configure.on_version_apply`,
      which allows user-defined code to be invoked each time an individual
      upgrade, downgrade, or stamp operation proceeds against a database.
      Pull request courtesy John Passaro.

    .. change:: 433
      :tags: bug, autogenerate
      :tickets: 433

      Fixed bug where autogen comparison of a :class:`.Variant` datatype
      would not compare to the dialect level type for the "default"
      implementation of the :class:`.Variant`, returning the type as changed
      between database and table metadata.

    .. change:: 431
      :tags: bug, tests
      :tickets: 431

      Fixed unit tests to run correctly under the SQLAlchemy 1.0.x series
      prior to version 1.0.10 where a particular bug involving Postgresql
      exclude constraints was fixed.

.. changelog::
    :version: 0.9.2
    :released: May 18, 2017

    .. change:: 429
      :tags: bug, mssql
      :tickets: 429

      Repaired :meth:`.Operations.rename_table` for SQL Server when the
      target table is in a remote schema, the schema name is omitted from
      the "new name" argument.

    .. change:: 425
      :tags: feature, commands
      :tickets: 425

      Added a new configuration option ``timezone``, a string timezone name
      that will be applied to the create date timestamp rendered
      inside the revision file as made available to the ``file_template`` used
      to generate the revision filename.  Note this change adds the
      ``python-dateutil`` package as a dependency.

    .. change:: 421
      :tags: bug, autogenerate
      :tickets: 421

      The autogenerate compare scheme now takes into account the name truncation
      rules applied by SQLAlchemy's DDL compiler to the names of the
      :class:`.Index` object, when these names are dynamically truncated
      due to a too-long identifier name.   As the identifier truncation is
      deterministic, applying the same rule to the metadata name allows
      correct comparison to the database-derived name.

    .. change:: 419
      :tags: bug environment
      :tickets: 419

      A warning is emitted when an object that's not a
      :class:`~sqlalchemy.engine.Connection` is passed to
      :meth:`.EnvironmentContext.configure`.  For the case of a
      :class:`~sqlalchemy.engine.Engine` passed, the check for "in transaction"
      introduced in version 0.9.0 has been relaxed to work in the case of an
      attribute error, as some users appear to be passing an
      :class:`~sqlalchemy.engine.Engine` and not a
      :class:`~sqlalchemy.engine.Connection`.

.. changelog::
    :version: 0.9.1
    :released: March 1, 2017

    .. change:: 417
      :tags: bug, commands
      :tickets: 417, 369

      An adjustment to the bug fix for :ticket:`369` to accommodate for
      env.py scripts that use an enclosing transaction distinct from the
      one that the context provides, so that the check for "didn't commit
      the transaction" doesn't trigger in this scenario.

.. changelog::
    :version: 0.9.0
    :released: February 28, 2017

    .. change:: 38
      :tags: feature, autogenerate
      :tickets: 38

      The :paramref:`.EnvironmentContext.configure.target_metadata` parameter
      may now be optionally specified as a sequence of :class:`.MetaData`
      objects instead of a single :class:`.MetaData` object.  The
      autogenerate process will process the sequence of :class:`.MetaData`
      objects in order.

    .. change:: 369
      :tags: bug, commands
      :tickets: 369

      A :class:`.CommandError` is now raised when a migration file opens
      a database transaction and does not close/commit/rollback, when
      the backend database or environment options also specify transactional_ddl
      is False.   When transactional_ddl is not in use, Alembic doesn't
      close any transaction so a transaction opened by a migration file
      will cause the following migrations to fail to apply.

    .. change:: 413
      :tags: bug, autogenerate, mysql
      :tickets: 413

      The ``autoincrement=True`` flag is now rendered within the
      :meth:`.Operations.alter_column` operation if the source column indicates
      that this flag should be set to True.  The behavior is sensitive to
      the SQLAlchemy version in place, as the "auto" default option is new
      in SQLAlchemy 1.1.  When the source column indicates autoincrement
      as True or "auto", the flag will render as True if the original column
      contextually indicates that it should have "autoincrement" keywords,
      and when the source column explcitly sets it to False, this is also
      rendered.  The behavior is intended to preserve the AUTO_INCREMENT flag
      on MySQL as the column is fully recreated on this backend.  Note that this
      flag does **not** support alteration of a column's "autoincrement" status,
      as this is not portable across backends.

    .. change:: 411
      :tags: bug, postgresql
      :tickets: 411

      Fixed bug where Postgresql JSON/JSONB types rendered on SQLAlchemy
      1.1 would render the "astext_type" argument which defaults to
      the ``Text()`` type without the module prefix, similarly to the
      issue with ARRAY fixed in :ticket:`85`.

    .. change:: 85
      :tags: bug, postgresql
      :tickets: 85

      Fixed bug where Postgresql ARRAY type would not render the import prefix
      for the inner type; additionally, user-defined renderers take place
      for the inner type as well as the outer type.  Pull request courtesy
      Paul Brackin.

    .. change:: process_revision_directives_command
      :tags: feature, autogenerate

      Added a keyword argument ``process_revision_directives`` to the
      :func:`.command.revision` API call.  This function acts in the
      same role as the environment-level
      :paramref:`.EnvironmentContext.configure.process_revision_directives`,
      and allows API use of the
      command to drop in an ad-hoc directive process function.  This
      function can be used among other things to place a complete
      :class:`.MigrationScript` structure in place.

    .. change:: 412
      :tags: feature, postgresql
      :tickets: 412

      Added support for Postgresql EXCLUDE constraints, including the
      operation directive :meth:`.Operations.create_exclude_constraints`
      as well as autogenerate render support for the ``ExcludeConstraint``
      object as present in a ``Table``.  Autogenerate detection for an EXCLUDE
      constraint added or removed to/from an existing table is **not**
      implemented as the SQLAlchemy Postgresql dialect does not yet support
      reflection of EXCLUDE constraints.

      Additionally, unknown constraint types now warn when
      encountered within an autogenerate action rather than raise.

    .. change:: fk_schema_compare
      :tags: bug, operations

      Fixed bug in :func:`.ops.create_foreign_key` where the internal table
      representation would not be created properly if the foreign key referred
      to a table in a different schema of the same name.  Pull request
      courtesy Konstantin Lebedev.

.. changelog::
    :version: 0.8.10
    :released: January 17, 2017

    .. change:: 406
      :tags: bug, versioning
      :tickets: 406

      The alembic_version table, when initially created, now establishes a
      primary key constraint on the "version_num" column, to suit database
      engines that don't support tables without primary keys.   This behavior
      can be controlled using the parameter
      :paramref:`.EnvironmentContext.configure.version_table_pk`.  Note that
      this change only applies to the initial creation of the alembic_version
      table; it does not impact any existing alembic_version table already
      present.

    .. change:: 402
      :tags: bug, batch
      :tickets: 402

      Fixed bug where doing ``batch_op.drop_constraint()`` against the
      primary key constraint would fail to remove the "primary_key" flag
      from the column, resulting in the constraint being recreated.

    .. change:: update_uq_dedupe
      :tags: bug, autogenerate, oracle

      Adjusted the logic originally added for :ticket:`276` that detects MySQL
      unique constraints which are actually unique indexes to be generalized
      for any dialect that has this behavior, for SQLAlchemy version 1.0 and
      greater.  This is to allow for upcoming SQLAlchemy support for unique
      constraint reflection for Oracle, which also has no dedicated concept of
      "unique constraint" and instead establishes a unique index.

    .. change:: 356
      :tags: bug, versioning
      :tickets: 356

      Added a file ignore for Python files of the form ``.#<name>.py``,
      which are generated by the Emacs editor.  Pull request courtesy
      Markus Mattes.

.. changelog::
    :version: 0.8.9
    :released: November 28, 2016

    .. change::  393
      :tags: bug, autogenerate
      :tickets: 393

      Adjustment to the "please adjust!" comment in the script.py.mako
      template so that the generated comment starts with a single pound
      sign, appeasing flake8.

    .. change::
      :tags: bug, batch
      :tickets: 391

      Batch mode will not use CAST() to copy data if ``type_`` is given, however
      the basic type affinity matches that of the existing type.  This to
      avoid SQLite's CAST of TIMESTAMP which results in truncation of the
      data, in those cases where the user needs to add redundant ``type_`` for
      other reasons.

    .. change::
      :tags: bug, autogenerate
      :tickets: 393

      Continued pep8 improvements by adding appropriate whitespace in
      the base template for generated migrations.  Pull request courtesy
      Markus Mattes.

    .. change::
      :tags: bug, revisioning

      Added an additional check when reading in revision files to detect
      if the same file is being read twice; this can occur if the same directory
      or a symlink equivalent is present more than once in version_locations.
      A warning is now emitted and the file is skipped.  Pull request courtesy
      Jiri Kuncar.

    .. change::
      :tags: bug, autogenerate
      :tickets: 395

      Fixed bug where usage of a custom TypeDecorator which returns a
      per-dialect type via :meth:`.TypeDecorator.load_dialect_impl` that differs
      significantly from the default "impl" for the type decorator would fail
      to compare correctly during autogenerate.

    .. change::
      :tags: bug, autogenerate, postgresql
      :tickets: 392

      Fixed bug in Postgresql "functional index skip" behavior where a
      functional index that ended in ASC/DESC wouldn't be detected as something
      we can't compare in autogenerate, leading to duplicate definitions
      in autogenerated files.

    .. change::
      :tags: bug, versioning

      Fixed bug where the "base" specifier, as in "base:head", could not
      be used explicitly when ``--sql`` mode was present.

.. changelog::
    :version: 0.8.8
    :released: September 12, 2016

    .. change::
       :tags: autogenerate

       The imports in the default script.py.mako are now at the top
       so that flake8 editors don't complain by default.  PR courtesy
       Guilherme Mansur.

    .. change::
      :tags: feature, operations, postgresql
      :tickets: 292

      Added support for the USING clause to the ALTER COLUMN operation
      for Postgresql.  Support is via the
      :paramref:`.op.alter_column.postgresql_using`
      parameter.  Pull request courtesy Frazer McLean.

    .. change::
      :tags: feature, autogenerate

      Autogenerate with type comparison enabled will pick up on the timezone
      setting changing between DateTime types.   Pull request courtesy
      David Szotten.

.. changelog::
    :version: 0.8.7
    :released: July 26, 2016

    .. change::
      :tags: bug, versioning
      :tickets: 336

      Fixed bug where upgrading to the head of a branch which is already
      present would fail, only if that head were also the dependency
      of a different branch that is also upgraded, as the revision system
      would see this as trying to go in the wrong direction.   The check
      here has been refined to distinguish between same-branch revisions
      out of order vs. movement along sibling branches.

    .. change::
      :tags: bug, versioning
      :tickets: 379

      Adjusted the version traversal on downgrade
      such that we can downgrade to a version that is a dependency for
      a version in a different branch, *without* needing to remove that
      dependent version as well.  Previously, the target version would be
      seen as a "merge point" for it's normal up-revision as well as the
      dependency.  This integrates with the changes for :ticket:`377`
      and :ticket:`378` to improve treatment of branches with dependencies
      overall.

    .. change::
      :tags: bug, versioning
      :tickets: 377

      Fixed bug where a downgrade to a version that is also a dependency
      to a different branch would fail, as the system attempted to treat
      this as an "unmerge" of a merge point, when in fact it doesn't have
      the other side of the merge point available for update.

    .. change::
      :tags: bug, versioning
      :tickets: 378

      Fixed bug where the "alembic current" command wouldn't show a revision
      as a current head if it were also a dependency of a version in a
      different branch that's also applied.   Extra logic is added to
      extract "implied" versions of different branches from the top-level
      versions listed in the alembic_version table.

    .. change::
      :tags: bug, versioning

      Fixed bug where a repr() or str() of a Script object would fail
      if the script had multiple dependencies.

    .. change::
      :tags: bug, autogenerate

      Fixed bug in autogen where if the DB connection sends the default
      schema as "None", this "None" would be removed from the list of
      schemas to check if include_schemas were set.  This could possibly
      impact using include_schemas with SQLite.

    .. change::
      :tags: bug, batch

      Small adjustment made to the batch handling for reflected CHECK
      constraints to accommodate for SQLAlchemy 1.1 now reflecting these.
      Batch mode still does not support CHECK constraints from the reflected
      table as these can't be easily differentiated from the ones created
      by types such as Boolean.

.. changelog::
    :version: 0.8.6
    :released: April 14, 2016

    .. change::
      :tags: bug, commands
      :tickets: 367

      Errors which occur within the Mako render step are now intercepted
      and raised as CommandErrors like other failure cases; the Mako
      exception itself is written using template-line formatting to
      a temporary file which is named in the exception message.

    .. change::
      :tags: bug, postgresql
      :tickets: 365

      Added a fix to Postgresql server default comparison which first checks
      if the text of the default is identical to the original, before attempting
      to actually run the default.  This accommodates for default-generation
      functions that generate a new value each time such as a uuid function.

    .. change::
      :tags: bug, batch
      :tickets: 361

      Fixed bug introduced by the fix for :ticket:`338` in version 0.8.4
      where a server default could no longer be dropped in batch mode.
      Pull request courtesy Martin Domke.

    .. change::
      :tags: bug, batch, mssql

      Fixed bug where SQL Server arguments for drop_column() would not
      be propagated when running under a batch block.  Pull request
      courtesy Michal Petrucha.

.. changelog::
    :version: 0.8.5
    :released: March 9, 2016

    .. change::
      :tags: bug, autogenerate
      :tickets: 335

      Fixed bug where the columns rendered in a ``PrimaryKeyConstraint``
      in autogenerate would inappropriately render the "key" of the
      column, not the name.  Pull request courtesy Jesse Dhillon.

    .. change::
      :tags: bug, batch
      :tickets: 354

      Repaired batch migration support for "schema" types which generate
      constraints, in particular the ``Boolean`` datatype which generates
      a CHECK constraint.  Previously, an alter column operation with this
      type would fail to correctly accommodate for the CHECK constraint
      on change both from and to this type.  In the former case the operation
      would fail entirely, in the latter, the CHECK constraint would
      not get generated.  Both of these issues are repaired.

    .. change::
      :tags: bug, mysql
      :tickets: 355

      Changing a schema type such as ``Boolean`` to a non-schema type would
      emit a drop constraint operation which emits ``NotImplementedError`` for
      the MySQL dialect.  This drop constraint operation is now skipped when
      the constraint originates from a schema type.

.. changelog::
    :version: 0.8.4
    :released: December 15, 2015

    .. change::
      :tags: feature, versioning

      A major improvement to the hash id generation function, which for some
      reason used an awkward arithmetic formula against uuid4() that produced
      values that tended to start with the digits 1-4.  Replaced with a
      simple substring approach which provides an even distribution.  Pull
      request courtesy Antti Haapala.

    .. change::
      :tags: feature, autogenerate

      Added an autogenerate renderer for the :class:`.ExecuteSQLOp` operation
      object; only renders if given a plain SQL string, otherwise raises
      NotImplementedError.  Can be of help with custom autogenerate
      sequences that includes straight SQL execution.  Pull request courtesy
      Jacob Magnusson.

    .. change::
      :tags: bug, batch
      :tickets: 345

      Batch mode generates a FOREIGN KEY constraint that is self-referential
      using the ultimate table name, rather than ``_alembic_batch_temp``.
      When the table is renamed from ``_alembic_batch_temp`` back to the
      original name, the FK now points to the right name.  This
      will **not** work if referential integrity is being enforced (eg. SQLite
      "PRAGMA FOREIGN_KEYS=ON") since the original table is dropped and
      the new table then renamed to that name, however this is now consistent
      with how foreign key constraints on **other** tables already operate
      with batch mode; these don't support batch mode if referential integrity
      is enabled in any case.

    .. change::
      :tags: bug, autogenerate
      :tickets: 341

      Added a type-level comparator that distinguishes :class:`.Integer`,
      :class:`.BigInteger`, and :class:`.SmallInteger` types and
      dialect-specific types; these all have "Integer" affinity so previously
      all compared as the same.

    .. change::
      :tags: bug, batch
      :tickets: 338

      Fixed bug where the ``server_default`` parameter of ``alter_column()``
      would not function correctly in batch mode.

    .. change::
      :tags: bug, autogenerate
      :tickets: 337

      Adjusted the rendering for index expressions such that a :class:`.Column`
      object present in the source :class:`.Index` will not be rendered
      as table-qualified; e.g. the column name will be rendered alone.
      Table-qualified names here were failing on systems such as Postgresql.

.. changelog::
    :version: 0.8.3
    :released: October 16, 2015

    .. change::
      :tags: bug, autogenerate
      :tickets: 332

      Fixed an 0.8 regression whereby the "imports" dictionary member of
      the autogen context was removed; this collection is documented in the
      "render custom type" documentation as a place to add new imports.
      The member is now known as
      :attr:`.AutogenContext.imports` and the documentation is repaired.

    .. change::
      :tags: bug, batch
      :tickets: 333

      Fixed bug in batch mode where a table that had pre-existing indexes
      would create the same index on the new table with the same name,
      which on SQLite produces a naming conflict as index names are in a
      global namespace on that backend.   Batch mode now defers the production
      of both existing and new indexes until after the entire table transfer
      operation is complete, which also means those indexes no longer take
      effect during the INSERT from SELECT section as well; the indexes
      are applied in a single step afterwards.

    .. change::
      :tags: bug, tests

      Added "pytest-xdist" as a tox dependency, so that the -n flag
      in the test command works if this is not already installed.
      Pull request courtesy Julien Danjou.

    .. change::
      :tags: bug, autogenerate, postgresql
      :tickets: 324

      Fixed issue in PG server default comparison where model-side defaults
      configured with Python unicode literals would leak the "u" character
      from a ``repr()`` into the SQL used for comparison, creating an invalid
      SQL expression, as the server-side comparison feature in PG currently
      repurposes the autogenerate Python rendering feature to get a quoted
      version of a plain string default.


.. changelog::
    :version: 0.8.2
    :released: August 25, 2015

    .. change::
      :tags: bug, autogenerate
      :tickets: 321

      Added workaround in new foreign key option detection feature for
      MySQL's consideration of the "RESTRICT" option being the default,
      for which no value is reported from the database; the MySQL impl now
      corrects for when the model reports RESTRICT but the database reports
      nothing.   A similar rule is in the default FK comparison to accommodate
      for the default "NO ACTION" setting being present in the model but not
      necessarily reported by the database, or vice versa.

.. changelog::
    :version: 0.8.1
    :released: August 22, 2015

    .. change::
      :tags: feature, autogenerate

      A custom :paramref:`.EnvironmentContext.configure.process_revision_directives`
      hook can now generate op directives within the :class:`.UpgradeOps`
      and :class:`.DowngradeOps` containers that will be generated as Python
      code even when the ``--autogenerate`` flag is False; provided that
      ``revision_environment=True``, the full render operation will be run
      even in "offline" mode.

    .. change::
      :tags: bug, autogenerate

      Repaired the render operation for the :class:`.ops.AlterColumnOp` object
      to succeed when the "existing_type" field was not present.

    .. change::
      :tags: bug, autogenerate
      :tickets: 318

      Fixed a regression 0.8 whereby the "multidb" environment template
      failed to produce independent migration script segments for the
      output template.  This was due to the reorganization of the script
      rendering system for 0.8.  To accommodate this change, the
      :class:`.MigrationScript` structure will in the case of multiple
      calls to :meth:`.MigrationContext.run_migrations` produce lists
      for the :attr:`.MigrationScript.upgrade_ops` and
      :attr:`.MigrationScript.downgrade_ops` attributes; each :class:`.UpgradeOps`
      and :class:`.DowngradeOps` instance keeps track of its own
      ``upgrade_token`` and ``downgrade_token``, and each are rendered
      individually.

      .. seealso::

        :ref:`autogen_customizing_multiengine_revision` - additional detail
        on the workings of the
        :paramref:`.EnvironmentContext.configure.process_revision_directives`
        parameter when multiple calls to :meth:`.MigrationContext.run_migrations`
        are made.


    .. change::
      :tags: feature, autogenerate
      :tickets: 317

      Implemented support for autogenerate detection of changes in the
      ``ondelete``, ``onupdate``, ``initially`` and ``deferrable``
      attributes of :class:`.ForeignKeyConstraint` objects on
      SQLAlchemy backends that support these on reflection
      (as of SQLAlchemy 1.0.8 currently Postgresql for all four,
      MySQL for ``ondelete`` and  ``onupdate`` only).   A constraint object
      that modifies these values will be reported as a "diff" and come out
      as a drop/create of the constraint with the modified values.
      The fields are ignored for backends which don't reflect these
      attributes (as of SQLA 1.0.8 this includes SQLite, Oracle, SQL Server,
      others).

.. changelog::
    :version: 0.8.0
    :released: August 12, 2015

    .. change::
      :tags: bug, batch
      :tickets: 315

      Fixed bug in batch mode where the ``batch_op.create_foreign_key()``
      directive would be incorrectly rendered with the source table and
      schema names in the argument list.

    .. change::
      :tags: feature, commands

      Added new command ``alembic edit``.  This command takes the same
      arguments as ``alembic show``, however runs the target script
      file within $EDITOR.  Makes use of the ``python-editor`` library
      in order to facilitate the handling of $EDITOR with reasonable
      default behaviors across platforms.  Pull request courtesy
      Michel Albert.

    .. change::
      :tags: feature, commands
      :tickets: 311

      Added new multiple-capable argument ``--depends-on`` to the
      ``alembic revision`` command, allowing ``depends_on`` to be
      established at the command line level rather than having to edit
      the file after the fact. ``depends_on`` identifiers may also be
      specified as branch names at the command line or directly within
      the migration file. The values may be specified as partial
      revision numbers from the command line which will be resolved to
      full revision numbers in the output file.

    .. change::
      :tags: change, operations

      A range of positional argument names have been changed to be
      clearer and more consistent across methods within the
      :class:`.Operations` namespace.   The most prevalent form of name change
      is that the descriptive names ``constraint_name`` and ``table_name``
      are now used where previously the name ``name`` would be used.
      This is in support of the newly modularized and extensible system of
      operation objects in :mod:`alembic.operations.ops`.
      An argument translation layer is in place
      across the ``alembic.op`` namespace that will ensure that named
      argument calling styles that use the old names will continue to
      function by transparently translating to the new names,
      also emitting a warning.   This, along with the fact that these
      arguments are positional in any case and aren't normally
      passed with an explicit name, should ensure that the
      overwhelming majority of applications should be unaffected by this
      change.   The *only* applications that are impacted are those that:

      1. use the :class:`.Operations` object directly in some way, rather
         than calling upon the ``alembic.op`` namespace, and

      2. invoke the methods on :class:`.Operations` using named keyword
         arguments for positional arguments like ``table_name``,
         ``constraint_name``, etc., which commonly were named ``name``
         as of 0.7.6.

      3. any application that is using named keyword arguments in place
         of positional argument for the recently added
         :class:`.BatchOperations` object may also be affected.

      The naming changes are documented as "versionchanged" for 0.8.0:

      * :meth:`.BatchOperations.create_check_constraint`
      * :meth:`.BatchOperations.create_foreign_key`
      * :meth:`.BatchOperations.create_index`
      * :meth:`.BatchOperations.create_unique_constraint`
      * :meth:`.BatchOperations.drop_constraint`
      * :meth:`.BatchOperations.drop_index`
      * :meth:`.Operations.create_check_constraint`
      * :meth:`.Operations.create_foreign_key`
      * :meth:`.Operations.create_primary_key`
      * :meth:`.Operations.create_index`
      * :meth:`.Operations.create_table`
      * :meth:`.Operations.create_unique_constraint`
      * :meth:`.Operations.drop_constraint`
      * :meth:`.Operations.drop_index`
      * :meth:`.Operations.drop_table`


    .. change::
      :tags: feature, tests

      The default test runner via "python setup.py test" is now py.test.
      nose still works via run_tests.py.

    .. change::
      :tags: feature, operations
      :tickets: 302

      The internal system for Alembic operations has been reworked to now
      build upon an extensible system of operation objects.  New operations
      can be added to the ``op.`` namespace, including that they are
      available in custom autogenerate schemes.

      .. seealso::

          :ref:`operation_plugins`

    .. change::
      :tags: feature, autogenerate
      :tickets: 301, 306

      The internal system for autogenerate been reworked to build upon
      the extensible system of operation objects present in
      :ticket:`302`.  As part of this change, autogenerate now produces
      a full object graph representing a list of migration scripts to
      be written as well as operation objects that will render all the
      Python code within them; a new hook
      :paramref:`.EnvironmentContext.configure.process_revision_directives`
      allows end-user code to fully customize what autogenerate will do,
      including not just full manipulation of the Python steps to take
      but also what file or files will be written and where.  Additionally,
      autogenerate is now extensible as far as database objects compared
      and rendered into scripts; any new operation directive can also be
      registered into a series of hooks that allow custom database/model
      comparison functions to run as well as to render new operation
      directives into autogenerate scripts.

      .. seealso::

        :ref:`alembic.autogenerate.toplevel`

    .. change::
      :tags: bug, versioning
      :tickets: 314

      Fixed bug where in the erroneous case that alembic_version contains
      duplicate revisions, some commands would fail to process the
      version history correctly and end up with a KeyError.   The fix
      allows the versioning logic to proceed, however a clear error is
      emitted later when attempting to update the alembic_version table.

.. changelog::
    :version: 0.7.7
    :released: July 22, 2015

    .. change::
      :tags: bug, versioning
      :tickets: 310

      Fixed critical issue where a complex series of branches/merges would
      bog down the iteration algorithm working over redundant nodes for
      millions of cycles.   An internal adjustment has been
      made so that duplicate nodes are skipped within this iteration.

    .. change::
      :tags: feature, batch
      :tickets: 305

      Implemented support for :meth:`.BatchOperations.create_primary_key`
      and :meth:`.BatchOperations.create_check_constraint`. Additionally,
      table keyword arguments are copied from the original reflected table,
      such as the "mysql_engine" keyword argument.

    .. change::
      :tags: bug, environment
      :tickets: 300

      The :meth:`.MigrationContext.stamp` method, added as part of the
      versioning refactor in 0.7 as a more granular version of
      :func:`.command.stamp`, now includes the "create the alembic_version
      table if not present" step in the same way as the command version,
      which was previously omitted.

    .. change::
      :tags: bug, autogenerate
      :tickets: 298

      Fixed bug where foreign key options including "onupdate",
      "ondelete" would not render within the ``op.create_foreign_key()``
      directive, even though they render within a full
      ``ForeignKeyConstraint`` directive.

    .. change::
      :tags: bug, tests

      Repaired warnings that occur when running unit tests against
      SQLAlchemy 1.0.5 or greater involving the "legacy_schema_aliasing"
      flag.

.. changelog::
    :version: 0.7.6
    :released: May 5, 2015

    .. change::
      :tags: feature, versioning
      :tickets: 297

      Fixed bug where the case of multiple mergepoints that all
      have the identical set of ancestor revisions would fail to be
      upgradable, producing an assertion failure.   Merge points were
      previously assumed to always require at least an UPDATE in
      alembic_revision from one of the previous revs to the new one,
      however in this case, if one of the mergepoints has already
      been reached, the remaining mergepoints have no row to UPDATE therefore
      they must do an INSERT of their target version.

    .. change::
      :tags: feature, autogenerate
      :tickets: 296

      Added support for type comparison functions to be not just per
      environment, but also present on the custom types themselves, by
      supplying a method ``compare_against_backend``.
      Added a new documentation section :ref:`compare_types` describing
      type comparison fully.

    .. change::
      :tags: feature, operations
      :tickets: 255

      Added a new option
      :paramref:`.EnvironmentContext.configure.literal_binds`, which
      will pass the ``literal_binds`` flag into the compilation of SQL
      constructs when using "offline" mode.  This has the effect that
      SQL objects like inserts, updates, deletes as well as textual
      statements sent using ``text()`` will be compiled such that the dialect
      will attempt to render literal values "inline" automatically.
      Only a subset of types is typically supported; the
      :meth:`.Operations.inline_literal` construct remains as the construct
      used to force a specific literal representation of a value.
      The :paramref:`.EnvironmentContext.configure.literal_binds` flag
      is added to the "offline" section of the ``env.py`` files generated
      in new environments.

    .. change::
      :tags: bug, batch
      :tickets: 289

      Fully implemented the
      :paramref:`~.Operations.batch_alter_table.copy_from` parameter for
      batch mode, which previously was not functioning.  This allows
      "batch mode" to be usable in conjunction with ``--sql``.

    .. change::
      :tags: bug, batch
      :tickets: 287

      Repaired support for the :meth:`.BatchOperations.create_index`
      directive, which was mis-named internally such that the operation
      within a batch context could not proceed.   The create index
      operation will proceed as part of a larger "batch table recreate"
      operation only if
      :paramref:`~.Operations.batch_alter_table.recreate` is set to
      "always", or if the batch operation includes other instructions that
      require a table recreate.


.. changelog::
    :version: 0.7.5
    :released: March 19, 2015

    .. change::
      :tags: bug, autogenerate
      :tickets: 266

      The ``--autogenerate`` option is not valid when used in conjunction
      with "offline" mode, e.g. ``--sql``.  This now raises a ``CommandError``,
      rather than failing more deeply later on.  Pull request courtesy
      Johannes Erdfelt.

    .. change::
      :tags: bug, operations, mssql
      :tickets: 284

      Fixed bug where the mssql DROP COLUMN directive failed to include
      modifiers such as "schema" when emitting the DDL.

    .. change::
      :tags: bug, autogenerate, postgresql
      :tickets: 282

      Postgresql "functional" indexes are necessarily skipped from the
      autogenerate process, as the SQLAlchemy backend currently does not
      support reflection of these structures.   A warning is emitted
      both from the SQLAlchemy backend as well as from the Alembic
      backend for Postgresql when such an index is detected.

    .. change::
      :tags: bug, autogenerate, mysql
      :tickets: 276

      Fixed bug where MySQL backend would report dropped unique indexes
      and/or constraints as both at the same time.  This is because
      MySQL doesn't actually have a "unique constraint" construct that
      reports differently than a "unique index", so it is present in both
      lists.  The net effect though is that the MySQL backend will report
      a dropped unique index/constraint as an index in cases where the object
      was first created as a unique constraint, if no other information
      is available to make the decision.  This differs from other backends
      like Postgresql which can report on unique constraints and
      unique indexes separately.

    .. change::
      :tags: bug, commands
      :tickets: 269

      Fixed bug where using a partial revision identifier as the
      "starting revision" in ``--sql`` mode in a downgrade operation
      would fail to resolve properly.

      As a side effect of this change, the
      :meth:`.EnvironmentContext.get_starting_revision_argument`
      method will return the "starting" revision in its originally-
      given "partial" form in all cases, whereas previously when
      running within the :meth:`.command.stamp` command, it would have
      been resolved to a full number before passing it to the
      :class:`.EnvironmentContext`.  The resolution of this value to
      a real revision number has basically been moved to a more fundamental
      level within the offline migration process.

    .. change::
      :tags: feature, commands

      Added a new feature :attr:`.Config.attributes`, to help with the use
      case of sharing state such as engines and connections on the outside
      with a series of Alembic API calls; also added a new cookbook section
      to describe this simple but pretty important use case.

      .. seealso::

          :ref:`connection_sharing`

    .. change::
      :tags: feature, environment

      The format of the default ``env.py`` script has been refined a bit;
      it now uses context managers not only for the scope of the transaction,
      but also for connectivity from the starting engine.  The engine is also
      now called a "connectable" in support of the use case of an external
      connection being passed in.

    .. change::
      :tags: feature, versioning
      :tickets: 267

      Added support for "alembic stamp" to work when given "heads" as an
      argument, when multiple heads are present.

.. changelog::
    :version: 0.7.4
    :released: January 12, 2015

    .. change::
      :tags: bug, autogenerate, postgresql
      :tickets: 241

      Repaired issue where a server default specified without ``text()``
      that represented a numeric or floating point (e.g. with decimal places)
      value would fail in the Postgresql-specific check for "compare server
      default"; as PG accepts the value with quotes in the table specification,
      it's still valid.  Pull request courtesy Dimitris Theodorou.

    .. change::
      :tags: bug, autogenerate
      :tickets: 259

      The rendering of a :class:`~sqlalchemy.schema.ForeignKeyConstraint`
      will now ensure that the names of the source and target columns are
      the database-side name of each column, and not the value of the
      ``.key`` attribute as may be set only on the Python side.
      This is because Alembic generates the DDL for constraints
      as standalone objects without the need to actually refer to an in-Python
      :class:`~sqlalchemy.schema.Table` object, so there's no step that
      would resolve these Python-only key names to database column names.

    .. change::
      :tags: bug, autogenerate
      :tickets: 260

      Fixed bug in foreign key autogenerate where if the in-Python table
      used custom column keys (e.g. using the ``key='foo'`` kwarg to
      ``Column``), the comparison of existing foreign keys to those specified
      in the metadata would fail, as the reflected table would not have
      these keys available which to match up.  Foreign key comparison for
      autogenerate now ensures it's looking at the database-side names
      of the columns in all cases; this matches the same functionality
      within unique constraints and indexes.

    .. change::
      :tags: bug, autogenerate
      :tickets: 261

      Fixed issue in autogenerate type rendering where types that belong
      to modules that have the name "sqlalchemy" in them would be mistaken
      as being part of the ``sqlalchemy.`` namespace.  Pull req courtesy
      Bartosz Burclaf.

.. changelog::
    :version: 0.7.3
    :released: December 30, 2014

    .. change::
      :tags: bug, versioning
      :tickets: 258

      Fixed regression in new versioning system where upgrade / history
      operation would fail on AttributeError if no version files were
      present at all.

.. changelog::
    :version: 0.7.2
    :released: December 18, 2014

    .. change::
      :tags: bug, sqlite, autogenerate

      Adjusted the SQLite backend regarding autogen of unique constraints
      to work fully with the current SQLAlchemy 1.0, which now will report
      on UNIQUE constraints that have no name.

    .. change::
      :tags: bug, batch
      :tickets: 254

      Fixed bug in batch where if the target table contained multiple
      foreign keys to the same target table, the batch mechanics would
      fail with a "table already exists" error.  Thanks for the help
      on this from Lucas Kahlert.

    .. change::
      :tags: bug, mysql
      :tickets: 251

      Fixed an issue where the MySQL routine to skip foreign-key-implicit
      indexes would also catch unnamed unique indexes, as they would be
      named after the column and look like the FK indexes.  Pull request
      courtesy Johannes Erdfelt.

    .. change::
      :tags: bug, mssql, oracle
      :tickets: 253

      Repaired a regression in both the MSSQL and Oracle dialects whereby
      the overridden ``_exec()`` method failed to return a value, as is
      needed now in the 0.7 series.

.. changelog::
    :version: 0.7.1
    :released: December 3, 2014

    .. change::
      :tags: bug, batch

      The ``render_as_batch`` flag was inadvertently hardcoded to ``True``,
      so all autogenerates were spitting out batch mode...this has been
      fixed so that batch mode again is only when selected in env.py.

    .. change::
      :tags: feature, autogenerate
      :tickets: 178

      Support for autogenerate of FOREIGN KEY constraints has been added.
      These are delivered within the autogenerate process in the same
      manner as UNIQUE constraints, including ``include_object`` support.
      Big thanks to Ann Kamyshnikova for doing the heavy lifting here.

    .. change::
      :tags: feature, batch

      Added :paramref:`~.Operations.batch_alter_table.naming_convention`
      argument to :meth:`.Operations.batch_alter_table`, as this is necessary
      in order to drop foreign key constraints; these are often unnamed
      on the target database, and in the case that they are named, SQLAlchemy
      is as of the 0.9 series not including these names yet.

      .. seealso::

        :ref:`dropping_sqlite_foreign_keys`

    .. change::
      :tags: bug, batch

      Fixed bug where the "source_schema" argument was not correctly passed
      when calling :meth:`.BatchOperations.create_foreign_key`.  Pull
      request courtesy Malte Marquarding.

    .. change::
      :tags: bug, batch
      :tickets: 249

      Repaired the inspection, copying and rendering of CHECK constraints
      and so-called "schema" types such as Boolean, Enum within the batch
      copy system; the CHECK constraint will not be "doubled" when the table is
      copied, and additionally the inspection of the CHECK constraint for
      its member columns will no longer fail with an attribute error.

    .. change::
      :tags: feature, batch

      Added two new arguments
      :paramref:`.Operations.batch_alter_table.reflect_args`
      and :paramref:`.Operations.batch_alter_table.reflect_kwargs`, so that
      arguments may be passed directly to suit the
      :class:`~.sqlalchemy.schema.Table`
      object that will be reflected.

      .. seealso::

        :ref:`batch_controlling_table_reflection`

.. changelog::
    :version: 0.7.0
    :released: November 24, 2014

    .. change::
      :tags: feature, versioning
      :tickets: 167

      The "multiple heads / branches" feature has now landed.  This is
      by far the most significant change Alembic has seen since its inception;
      while the workflow of most commands hasn't changed, and the format
      of version files and the ``alembic_version`` table are unchanged as well,
      a new suite of features opens up in the case where multiple version
      files refer to the same parent, or to the "base".  Merging of
      branches, operating across distinct named heads, and multiple
      independent bases are now all supported.   The feature incurs radical
      changes to the internals of versioning and traversal, and should be
      treated as "beta mode" for the next several subsequent releases
      within 0.7.

      .. seealso::

          :ref:`branches`

    .. change::
      :tags: feature, versioning
      :tickets: 124

      In conjunction with support for multiple independent bases, the
      specific version directories are now also configurable to include
      multiple, user-defined directories.   When multiple directories exist,
      the creation of a revision file with no down revision requires
      that the starting directory is indicated; the creation of subsequent
      revisions along that lineage will then automatically use that
      directory for new files.

      .. seealso::

          :ref:`multiple_version_directories`

    .. change::
      :tags: feature, operations, sqlite
      :tickets: 21

      Added "move and copy" workflow, where a table to be altered is copied to
      a new one with the new structure and the old one dropped, is now
      implemented for SQLite as well as all database backends in general
      using the new :meth:`.Operations.batch_alter_table` system.   This
      directive provides a table-specific operations context which gathers
      column- and constraint-level mutations specific to that table, and
      at the end of the context creates a new table combining the structure
      of the old one with the given changes, copies data from old table to new,
      and finally drops the old table,
      renaming the new one to the existing name.  This is required for
      fully featured SQLite migrations, as SQLite has very little support for the
      traditional ALTER directive.   The batch directive
      is intended to produce code that is still compatible with other databases,
      in that the "move and copy" process only occurs for SQLite by default,
      while still providing some level of sanity to SQLite's
      requirement by allowing multiple table mutation operations to
      proceed within one "move and copy" as well as providing explicit
      control over when this operation actually occurs.  The "move and copy"
      feature may be optionally applied to other backends as well, however
      dealing with referential integrity constraints from other tables must
      still be handled explicitly.

      .. seealso::

          :ref:`batch_migrations`

    .. change::
      :tags: feature, commands

      Relative revision identifiers as used with ``alembic upgrade``,
      ``alembic downgrade`` and ``alembic history`` can be combined with
      specific revisions as well, e.g. ``alembic upgrade ae10+3``, to produce
      a migration target relative to the given exact version.

    .. change::
      :tags: bug, commands
      :tickets: 248

      The ``alembic revision`` command accepts the ``--sql`` option to
      suit some very obscure use case where the ``revision_environment``
      flag is set up, so that ``env.py`` is run when ``alembic revision``
      is run even though autogenerate isn't specified.   As this flag is
      otherwise confusing, error messages are now raised if
      ``alembic revision`` is invoked with both ``--sql`` and
      ``--autogenerate`` or with ``--sql`` without
      ``revision_environment`` being set.

    .. change::
      :tags: bug, autogenerate, postgresql
      :tickets: 247

      Added a rule for Postgresql to not render a "drop unique" and "drop index"
      given the same name; for now it is assumed that the "index" is the
      implicit one Postgreql generates.   Future integration with
      new SQLAlchemy 1.0 features will improve this to be more
      resilient.

    .. change::
      :tags: bug, autogenerate
      :tickets: 247

      A change in the ordering when columns and constraints are dropped;
      autogenerate will now place the "drop constraint" calls *before*
      the "drop column" calls, so that columns involved in those constraints
      still exist when the constraint is dropped.

    .. change::
      :tags: feature, commands

      New commands added: ``alembic show``, ``alembic heads`` and
      ``alembic merge``.  Also, a new option ``--verbose`` has been
      added to  several informational commands, such as ``alembic history``,
      ``alembic current``, ``alembic branches``, and ``alembic heads``.
      ``alembic revision`` also contains several new options used
      within the new branch management system.    The output of commands has
      been altered in many cases to support new fields and attributes;
      the ``history`` command in particular now returns it's "verbose" output
      only if ``--verbose`` is sent; without this flag it reverts to it's
      older behavior of short line items (which was never changed in the docs).

    .. change::
      :tags: changed, commands

      The ``--head_only`` option to the ``alembic current`` command is
      deprecated; the ``current`` command now lists just the version numbers
      alone by default; use ``--verbose`` to get at additional output.

    .. change::
      :tags: feature, config

      Added new argument :paramref:`.Config.config_args`, allows a dictionary
      of replacement variables to be passed which will serve as substitution
      values when an API-produced :class:`.Config` consumes the ``.ini``
      file.  Pull request courtesy Noufal Ibrahim.

    .. change::
      :tags: bug, oracle
      :tickets: 245

      The Oracle dialect sets "transactional DDL" to False by default,
      as Oracle does not support transactional DDL.

    .. change::
      :tags: bug, autogenerate
      :tickets: 243

      Fixed a variety of issues surrounding rendering of Python code that
      contains unicode literals.  The first is that the "quoted_name" construct
      that SQLAlchemy uses to represent table and column names as well
      as schema names does not ``repr()`` correctly on Py2K when the value
      contains unicode characters; therefore an explicit stringification is
      added to these.  Additionally, SQL expressions such as server defaults
      were not being generated in a unicode-safe fashion leading to decode
      errors if server defaults contained non-ascii characters.

    .. change::
      :tags: bug, operations
      :tickets: 174

      The :meth:`.Operations.add_column` directive will now additionally emit
      the appropriate ``CREATE INDEX`` statement if the
      :class:`~sqlalchemy.schema.Column` object specifies ``index=True``.
      Pull request courtesy David Szotten.

    .. change::
      :tags: feature, operations
      :tickets: 205

      The :class:`~sqlalchemy.schema.Table` object is now returned when
      the :meth:`.Operations.create_table` method is used.  This ``Table``
      is suitable for use in subsequent SQL operations, in particular
      the :meth:`.Operations.bulk_insert` operation.

    .. change::
      :tags: feature, autogenerate
      :tickets: 203

      Indexes and unique constraints are now included in the
      :paramref:`.EnvironmentContext.configure.include_object` hook.
      Indexes are sent with type ``"index"`` and unique constraints with
      type ``"unique_constraint"``.

    .. change::
      :tags: bug, autogenerate
      :tickets: 219

      Bound parameters are now resolved as "literal" values within the
      SQL expression inside of a CheckConstraint(), when rendering the SQL
      as a text string; supported for SQLAlchemy 0.8.0 and forward.

    .. change::
      :tags: bug, autogenerate
      :tickets: 199

      Added a workaround for SQLAlchemy issue #3023 (fixed in 0.9.5) where
      a column that's part of an explicit PrimaryKeyConstraint would not
      have its "nullable" flag set to False, thus producing a false
      autogenerate.  Also added a related correction to MySQL which will
      correct for MySQL's implicit server default of '0' when a NULL integer
      column is turned into a primary key column.

    .. change::
      :tags: bug, autogenerate, mysql
      :tickets: 240

      Repaired issue related to the fix for #208 and others; a composite
      foreign key reported by MySQL would cause a KeyError as Alembic
      attempted to remove MySQL's implicitly generated indexes from the
      autogenerate list.

    .. change::
      :tags: bug, autogenerate
      :tickets: 28

      If the "alembic_version" table is present in the target metadata,
      autogenerate will skip this also.  Pull request courtesy
      Dj Gilcrease.

    .. change::
      :tags: bug, autogenerate
      :tickets: 77

      The :paramref:`.EnvironmentContext.configure.version_table`
      and :paramref:`.EnvironmentContext.configure.version_table_schema`
      arguments are now honored during the autogenerate process, such that
      these names will be used as the "skip" names on both the database
      reflection and target metadata sides.

    .. change::
      :tags: changed, autogenerate
      :tickets: 229

      The default value of the
      :paramref:`.EnvironmentContext.configure.user_module_prefix`
      parameter is **no longer the same as the SQLAlchemy prefix**.
      When omitted, user-defined types will now use the ``__module__``
      attribute of the type class itself when rendering in an
      autogenerated module.

    .. change::
      :tags: bug, templates
      :tickets: 234

      Revision files are now written out using the ``'wb'`` modifier to
      ``open()``, since Mako reads the templates with ``'rb'``, thus preventing
      CRs from being doubled up as has been observed on windows.  The encoding
      of the output now defaults to 'utf-8', which can be configured using
      a newly added config file parameter ``output_encoding``.

    .. change::
      :tags: bug, operations
      :tickets: 230

      Added support for use of the :class:`~sqlalchemy.sql.elements.quoted_name`
      construct when using the ``schema`` argument within operations.  This
      allows a name containing a dot to be fully quoted, as well as to
      provide configurable quoting on a per-name basis.

    .. change::
      :tags: bug, autogenerate, postgresql
      :tickets: 73

      Added a routine by which the Postgresql Alembic dialect inspects
      the server default of INTEGER/BIGINT columns as they are reflected
      during autogenerate for the pattern ``nextval(<name>...)`` containing
      a potential sequence name, then queries ``pg_catalog`` to see if this
      sequence is "owned" by the column being reflected; if so, it assumes
      this is a SERIAL or BIGSERIAL column and the server default is
      omitted from the column reflection as well as any kind of
      server_default comparison or rendering, along with an INFO message
      in the logs indicating this has taken place. This allows SERIAL/BIGSERIAL
      columns to keep the SEQUENCE from being unnecessarily present within
      the autogenerate operation.

    .. change::
      :tags: bug, autogenerate
      :tickets: 197, 64, 196

      The system by which autogenerate renders expressions within
      a :class:`~sqlalchemy.schema.Index`, the ``server_default``
      of :class:`~sqlalchemy.schema.Column`, and the
      ``existing_server_default`` of
      :meth:`.Operations.alter_column` has been overhauled to anticipate
      arbitrary SQLAlchemy SQL constructs, such as ``func.somefunction()``,
      ``cast()``, ``desc()``, and others.   The system does not, as might
      be preferred, render the full-blown Python expression as originally
      created within the application's source code, as this would be exceedingly
      complex and difficult.  Instead, it renders the SQL expression against
      the target backend that's subject to the autogenerate, and then
      renders that SQL inside of a :func:`~sqlalchemy.sql.expression.text`
      construct as a literal SQL string.  This approach still has the
      downside that the rendered SQL construct may not be backend-agnostic
      in all cases, so there is still a need for manual intervention in that
      small number of cases, but overall the majority of cases should work
      correctly now.  Big thanks to Carlos Rivera for pull requests and
      support on this.

    .. change::
      :tags: feature

      SQLAlchemy's testing infrastructure is now used to run tests.
      This system supports both nose and pytest and opens the way
      for Alembic testing to support any number of backends, parallel
      testing, and 3rd party dialect testing.

    .. change::
      :tags: changed, compatibility

      Minimum SQLAlchemy version is now 0.7.6, however at least
      0.8.4 is strongly recommended.  The overhaul of the test suite
      allows for fully passing tests on all SQLAlchemy versions
      from 0.7.6 on forward.

    .. change::
      :tags: bug, operations

      The "match" keyword is not sent to :class:`.ForeignKeyConstraint`
      by :meth:`.Operations.create_foreign_key` when SQLAlchemy 0.7 is in use;
      this keyword was added to SQLAlchemy as of 0.8.0.

.. changelog::
    :version: 0.6.7
    :released: September 9, 2014

    .. change::
      :tags: bug, mssql

      Fixed bug in MSSQL dialect where "rename table" wasn't using
      ``sp_rename()`` as is required on SQL Server.  Pull request courtesy
      Łukasz Bołdys.

    .. change::
      :tags: feature
      :tickets: 222

      Added support for functional indexes when using the
      :meth:`.Operations.create_index` directive.   Within the list of columns,
      the SQLAlchemy ``text()`` construct can be sent, embedding a literal
      SQL expression; the :meth:`.Operations.create_index` will perform some hackery
      behind the scenes to get the :class:`.Index` construct to cooperate.
      This works around some current limitations in :class:`.Index`
      which should be resolved on the SQLAlchemy side at some point.

.. changelog::
    :version: 0.6.6
    :released: August 7, 2014

    .. change::
      :tags: bug
      :tickets: 95

      A file named ``__init__.py`` in the ``versions/`` directory is now
      ignored by Alembic when the collection of version files is retrieved.
      Pull request courtesy Michael Floering.

    .. change::
      :tags: bug

      Fixed Py3K bug where an attempt would be made to sort None against
      string values when autogenerate would detect tables across multiple
      schemas, including the default schema.  Pull request courtesy
      paradoxxxzero.

    .. change::
      :tags: bug

      Autogenerate render will render the arguments within a Table construct
      using ``*[...]`` when the number of columns/elements is greater than
      255.  Pull request courtesy Ryan P. Kelly.

    .. change::
      :tags: bug

      Fixed bug where foreign key constraints would fail to render in
      autogenerate when a schema name was present.  Pull request courtesy
      Andreas Zeidler.

    .. change::
      :tags: bug
      :tickets: 212

      Some deep-in-the-weeds fixes to try to get "server default" comparison
      working better across platforms and expressions, in particular on
      the Postgresql backend, mostly dealing with quoting/not quoting of various
      expressions at the appropriate time and on a per-backend basis.
      Repaired and tested support for such defaults as Postgresql interval
      and array defaults.

    .. change::
      :tags: enhancement
      :tickets: 209

      When a run of Alembic command line fails due to ``CommandError``,
      the output now prefixes the string with ``"FAILED:"``, and the error
      is also written to the log output using ``log.error()``.

    .. change::
      :tags: bug
      :tickets: 208

      Liberalized even more the check for MySQL indexes that shouldn't be
      counted in autogenerate as "drops"; this time it's been reported
      that an implicitly created index might be named the same as a composite
      foreign key constraint, and not the actual columns, so we now skip those
      when detected as well.

    .. change::
      :tags: feature

      Added a new accessor :attr:`.MigrationContext.config`, when used
      in conjunction with a :class:`.EnvironmentContext` and
      :class:`.Config`, this config will be returned.  Patch
      courtesy Marc Abramowitz.

.. changelog::
    :version: 0.6.5
    :released: May 3, 2014

    .. change::
      :tags: bug, autogenerate, mysql
      :tickets: 202

      This releases' "autogenerate index detection" bug, when a MySQL table
      includes an Index with the same name as a column, autogenerate reported
      it as an "add" even though its not; this is because we ignore reflected
      indexes of this nature due to MySQL creating them implicitly.  Indexes
      that are named the same as a column are now ignored on
      MySQL if we see that the backend is reporting that it already exists;
      this indicates that we can still detect additions of these indexes
      but not drops, as we cannot distinguish a backend index same-named
      as the column as one that is user generated or mysql-generated.

    .. change::
      :tags: feature, environment
      :tickets: 201

      Added new feature :paramref:`.EnvironmentContext.configure.transaction_per_migration`,
      which when True causes the BEGIN/COMMIT pair to incur for each migration
      individually, rather than for the whole series of migrations.  This is
      to assist with some database directives that need to be within individual
      transactions, without the need to disable transactional DDL entirely.

    .. change::
      :tags: bug, autogenerate
      :tickets: 200

      Fixed bug where the ``include_object()`` filter would not receive
      the original :class:`.Column` object when evaluating a database-only
      column to be dropped; the object would not include the parent
      :class:`.Table` nor other aspects of the column that are important
      for generating the "downgrade" case where the column is recreated.

    .. change::
      :tags: bug, environment
      :tickets: 195

      Fixed bug where :meth:`.EnvironmentContext.get_x_argument`
      would fail if the :class:`.Config` in use didn't actually
      originate from a command line call.

    .. change::
      :tags: bug, autogenerate
      :tickets: 194

      Fixed another bug regarding naming conventions, continuing
      from :ticket:`183`, where add_index()
      drop_index() directives would not correctly render the ``f()``
      construct when the index contained a convention-driven name.

.. changelog::
    :version: 0.6.4
    :released: March 28, 2014

    .. change::
      :tags: bug, mssql
      :tickets: 186

      Added quoting to the table name when the special EXEC is run to
      drop any existing server defaults or constraints when the
      :paramref:`.Operations.drop_column.mssql_drop_check` or
      :paramref:`.Operations.drop_column.mssql_drop_default`
      arguments are used.

    .. change::
      :tags: bug, mysql
      :tickets: 103

      Added/fixed support for MySQL "SET DEFAULT" / "DROP DEFAULT" phrases,
      which will now be rendered if only the server default is changing
      or being dropped (e.g. specify None to alter_column() to indicate
      "DROP DEFAULT").  Also added support for rendering MODIFY rather than
      CHANGE when the column name isn't changing.

    .. change::
      :tags: bug
      :tickets: 190

      Added support for the ``initially``, ``match`` keyword arguments
      as well as dialect-specific keyword arguments to
      :meth:`.Operations.create_foreign_key`.

      :tags: feature
      :tickets: 163

      Altered the support for "sourceless" migration files (e.g. only
      .pyc or .pyo present) so that the flag "sourceless=true" needs to
      be in alembic.ini for this behavior to take effect.

    .. change::
      :tags: bug, mssql
      :tickets: 185

      The feature that keeps on giving, index/unique constraint autogenerate
      detection, has even more fixes, this time to accommodate database dialects
      that both don't yet report on unique constraints, but the backend
      does report unique constraints as indexes.   The logic
      Alembic uses to distinguish between "this is an index!" vs.
      "this is a unique constraint that is also reported as an index!" has now
      been further enhanced to not produce unwanted migrations when the dialect
      is observed to not yet implement get_unique_constraints() (e.g. mssql).
      Note that such a backend will no longer report index drops for unique
      indexes, as these cannot be distinguished from an unreported unique
      index.

    .. change::
      :tags: bug
      :tickets: 183

      Extensive changes have been made to more fully support SQLAlchemy's new
      naming conventions feature.  Note that while SQLAlchemy has added this
      feature as of 0.9.2, some additional fixes in 0.9.4 are needed to
      resolve some of the issues:

      1. The :class:`.Operations` object now takes into account the naming
         conventions that are present on the :class:`.MetaData` object that's
         associated using :paramref:`~.EnvironmentContext.configure.target_metadata`.
         When :class:`.Operations` renders a constraint directive like
         ``ADD CONSTRAINT``, it now will make use of this naming convention
         when it produces its own temporary :class:`.MetaData` object.

      2. Note however that the autogenerate feature in most cases generates
         constraints like foreign keys and unique constraints with the
         final names intact; the only exception are the constraints implicit
         with a schema-type like Boolean or Enum.  In most of these cases,
         the naming convention feature will not take effect for these constraints
         and will instead use the given name as is, with one exception....

      3. Naming conventions which use the ``"%(constraint_name)s"`` token, that
         is, produce a new name that uses the original name as a component,
         will still be pulled into the naming convention converter and be
         converted.  The problem arises when autogenerate renders a constraint
         with it's already-generated name present in the migration file's source
         code, the name will be doubled up at render time due to the combination
         of #1 and #2.  So to work around this, autogenerate now renders these
         already-tokenized names using the new :meth:`.Operations.f` component.
         This component is only generated if **SQLAlchemy 0.9.4** or greater
         is in use.

      Therefore it is highly recommended that an upgrade to Alembic 0.6.4
      be accompanied by an upgrade of SQLAlchemy 0.9.4, if the new naming
      conventions feature is used.

      .. seealso::

          :ref:`autogen_naming_conventions`

    .. change::
      :tags: bug
      :tickets: 160

      Suppressed IOErrors which can raise when program output pipe
      is closed under a program like ``head``; however this only
      works on Python 2.  On Python 3, there is not yet a known way to
      suppress the BrokenPipeError warnings without prematurely terminating
      the program via signals.

    .. change::
      :tags: bug
      :tickets: 179

      Fixed bug where :meth:`.Operations.bulk_insert` would not function
      properly when :meth:`.Operations.inline_literal` values were used,
      either in --sql or non-sql mode.    The values will now render
      directly in --sql mode.  For compatibility with "online" mode,
      a new flag :paramref:`~.Operations.bulk_insert.multiinsert`
      can be set to False which will cause each parameter set to be
      compiled and executed with individual INSERT statements.

    .. change::
      :tags: bug, py3k
      :tickets: 175

      Fixed a failure of the system that allows "legacy keyword arguments"
      to be understood, which arose as of a change in Python 3.4 regarding
      decorators.  A workaround is applied that allows the code to work
      across Python 3 versions.

    .. change::
      :tags: feature

      The :func:`.command.revision` command now returns the :class:`.Script`
      object corresponding to the newly generated revision.  From this
      structure, one can get the revision id, the module documentation,
      and everything else, for use in scripts that call upon this command.
      Pull request courtesy Robbie Coomber.

.. changelog::
    :version: 0.6.3
    :released: February 2, 2014

    .. change::
      :tags: bug
      :tickets: 172

      Added a workaround for when we call ``fcntl.ioctl()`` to get at
      ``TERMWIDTH``; if the function returns zero, as is reported to occur
      in some pseudo-ttys, the message wrapping system is disabled in the
      same way as if ``ioctl()`` failed.

    .. change::
      :tags: feature
      :tickets: 171

      Added new argument
      :paramref:`.EnvironmentContext.configure.user_module_prefix`.
      This prefix is applied when autogenerate renders a user-defined type,
      which here is defined as any type that is from a module outside of the
      ``sqlalchemy.`` hierarchy.   This prefix defaults to ``None``, in
      which case the :paramref:`.EnvironmentContext.configure.sqlalchemy_module_prefix`
      is used, thus preserving the current behavior.

    .. change::
      :tags: bug
      :tickets: 170

      Added support for autogenerate covering the use case where :class:`.Table`
      objects specified in the metadata have an explicit ``schema`` attribute
      whose name matches that of the connection's default schema
      (e.g. "public" for Postgresql).  Previously, it was assumed that "schema"
      was ``None`` when it matched the "default" schema, now the comparison
      adjusts for this.

    .. change::
      :tags: bug

      The :func:`.compare_metadata` public API function now takes into
      account the settings for
      :paramref:`.EnvironmentContext.configure.include_object`,
      :paramref:`.EnvironmentContext.configure.include_symbol`,
      and :paramref:`.EnvironmentContext.configure.include_schemas`, in the
      same way that the ``--autogenerate`` command does.  Pull
      request courtesy Roman Podoliaka.

    .. change::
      :tags: bug
      :tickets: 168

      Calling :func:`.bulk_insert` with an empty list will not emit any
      commands on the current connection.  This was already the case with
      ``--sql`` mode, so is now the case with "online" mode.

    .. change::
      :tags: bug

     Enabled schema support for index and unique constraint autodetection;
     previously these were non-functional and could in some cases lead to
     attribute errors.  Pull request courtesy Dimitris Theodorou.

    .. change::
      :tags: bug
      :tickets: 164

     More fixes to index autodetection; indexes created with expressions
     like DESC or functional indexes will no longer cause AttributeError
     exceptions when attempting to compare the columns.

    .. change::
      :tags: feature
      :tickets: 163

     The :class:`.ScriptDirectory` system that loads migration files
     from a  ``versions/`` directory now supports so-called
     "sourceless" operation,  where the ``.py`` files are not present
     and instead ``.pyc`` or ``.pyo`` files are directly present where
     the ``.py`` files should be.  Note that while Python 3.3 has a
     new system of locating ``.pyc``/``.pyo`` files within a directory
     called ``__pycache__`` (e.g. PEP-3147), PEP-3147 maintains
     support for the "source-less imports" use case, where the
     ``.pyc``/``.pyo`` are in present in the "old" location, e.g. next
     to the ``.py`` file; this is the usage that's supported even when
     running Python3.3.


.. changelog::
    :version: 0.6.2
    :released: Fri Dec 27 2013

    .. change::
      :tags: bug

      Autogenerate for ``op.create_table()`` will not include a
      ``PrimaryKeyConstraint()`` that has no columns.

    .. change::
      :tags: bug

      Fixed bug in the not-internally-used :meth:`.ScriptDirectory.get_base`
      method which would fail if called on an empty versions directory.

    .. change::
      :tags: bug
      :tickets: 157

      An almost-rewrite of the new unique constraint/index autogenerate
      detection, to accommodate a variety of issues.  The emphasis is on
      not generating false positives for those cases where no net change
      is present, as these errors are the ones that impact all autogenerate
      runs:

        * Fixed an issue with unique constraint autogenerate detection where
          a named ``UniqueConstraint`` on both sides with column changes would
          render with the "add" operation before the "drop", requiring the
          user to reverse the order manually.

        * Corrected for MySQL's apparent addition of an implicit index
          for a foreign key column, so that it doesn't show up as "removed".
          This required that the index/constraint autogen system query the
          dialect-specific implementation for special exceptions.

        * reworked the "dedupe" logic to accommodate MySQL's bi-directional
          duplication of unique indexes as unique constraints, and unique
          constraints as unique indexes.  Postgresql's slightly different
          logic of duplicating unique constraints into unique indexes
          continues to be accommodated as well.  Note that a unique index
          or unique constraint removal on a backend that duplicates these may
          show up as a distinct "remove_constraint()" / "remove_index()" pair,
          which may need to be corrected in the post-autogenerate if multiple
          backends are being supported.

        * added another dialect-specific exception to the SQLite backend
          when dealing with unnamed unique constraints, as the backend can't
          currently report on constraints that were made with this technique,
          hence they'd come out as "added" on every run.

        * the ``op.create_table()`` directive will be auto-generated with
          the ``UniqueConstraint`` objects inline, but will not double them
          up with a separate ``create_unique_constraint()`` call, which may
          have been occurring.  Indexes still get rendered as distinct
          ``op.create_index()`` calls even when the corresponding table was
          created in the same script.

        * the inline ``UniqueConstraint`` within ``op.create_table()`` includes
          all the options like ``deferrable``, ``initially``, etc.  Previously
          these weren't rendering.

    .. change::
      :tags: feature, mssql

      Added new argument ``mssql_drop_foreign_key`` to
      :meth:`.Operations.drop_column`.  Like ``mssql_drop_default``
      and ``mssql_drop_check``, will do an inline lookup for a
      single foreign key which applies to this column, and drop it.
      For a column with more than one FK, you'd still need to explicitly
      use :meth:`.Operations.drop_constraint` given the name,
      even though only MSSQL has this limitation in the first place.

    .. change::
      :tags: bug, mssql

      The MSSQL backend will add the batch separator (e.g. ``"GO"``)
      in ``--sql`` mode after the final ``COMMIT`` statement, to ensure
      that statement is also processed in batch mode.  Courtesy
      Derek Harland.

.. changelog::
    :version: 0.6.1
    :released: Wed Nov 27 2013

    .. change::
      :tags: bug, mysql
      :tickets: 152

      Fixed bug where :func:`.op.alter_column` in the MySQL dialect
      would fail to apply quotes to column names that had mixed casing
      or spaces.

    .. change::
      :tags: feature

      Expanded the size of the "slug" generated by "revision" to 40
      characters, which is also configurable by new field
      ``truncate_slug_length``; and also split on the word rather than the
      character; courtesy Frozenball.

    .. change::
      :tags: bug
      :tickets: 135

      Fixed the output wrapping for Alembic message output, so that
      we either get the terminal width for "pretty printing" with
      indentation, or if not we just output the text as is; in any
      case the text won't be wrapped too short.

    .. change::
      :tags: bug

      Fixes to Py3k in-place compatibility regarding output encoding and related;
      the use of the new io.* package introduced some incompatibilities on Py2k.
      These should be resolved, due to the introduction of new adapter types
      for translating from io.* to Py2k file types, StringIO types.
      Thanks to Javier Santacruz for help with this.

    .. change::
      :tags: bug
      :tickets: 145

      Fixed py3k bug where the wrong form of ``next()`` was being called
      when using the list_templates command.  Courtesy Chris Wilkes.

    .. change::
      :tags: feature
      :tickets: 107

      Support for autogeneration detection and rendering of indexes and
      unique constraints has been added.  The logic goes through some effort
      in order to differentiate between true unique constraints and
      unique indexes, where there are some quirks on backends like Postgresql.
      The effort here in producing the feature and tests is courtesy of IJL.

    .. change::
      :tags: bug

      Fixed bug introduced by new ``include_object`` argument where the
      inspected column would be misinterpreted when using a user-defined
      type comparison function, causing a KeyError or similar expression-related
      error.  Fix courtesy Maarten van Schaik.

    .. change::
      :tags: bug

      Added the "deferrable" keyword argument to :func:`.op.create_foreign_key`
      so that ``DEFERRABLE`` constraint generation is supported; courtesy
      Pedro Romano.

    .. change::
      :tags: bug
      :tickets: 137

      Ensured that strings going to stdout go through an encode/decode phase,
      so that any non-ASCII characters get to the output stream correctly
      in both Py2k and Py3k.   Also added source encoding detection using
      Mako's parse_encoding() routine in Py2k so that the __doc__ of a
      non-ascii revision file can be treated as unicode in Py2k.

.. changelog::
    :version: 0.6.0
    :released: Fri July 19 2013

    .. change::
      :tags: feature
      :tickets: 101

      Added new kw argument to :meth:`.EnvironmentContext.configure`
      ``include_object``.  This is a more flexible version of the
      ``include_symbol`` argument which allows filtering of columns as well as tables
      from the autogenerate process,
      and in the future will also work for types, constraints and
      other constructs.  The fully constructed schema object is passed,
      including its name and type as well as a flag indicating if the object
      is from the local application metadata or is reflected.

    .. change::
      :tags: feature

      The output of the ``alembic history`` command is now
      expanded to show information about each change on multiple
      lines, including the full top message,
      resembling the formatting of git log.

    .. change::
      :tags: feature

      Added :attr:`alembic.config.Config.cmd_opts` attribute,
      allows access to the ``argparse`` options passed to the
      ``alembic`` runner.

    .. change::
      :tags: feature
      :tickets: 120

      Added new command line argument ``-x``, allows extra arguments
      to be appended to the command line which can be consumed
      within an ``env.py`` script by looking at
      ``context.config.cmd_opts.x``, or more simply a new
      method :meth:`.EnvironmentContext.get_x_argument`.

    .. change::
      :tags: bug
      :tickets: 125

      Added support for options like "name" etc. to be rendered
      within CHECK constraints in autogenerate.  Courtesy
      Sok Ann Yap.

    .. change::
      :tags: misc

      Source repository has been moved from Mercurial to Git.

    .. change::
      :tags: bug

      Repaired autogenerate rendering of ForeignKeyConstraint
      to include use_alter argument, if present.

    .. change::
      :tags: feature

      Added ``-r`` argument to ``alembic history`` command,
      allows specification of ``[start]:[end]`` to view
      a slice of history.  Accepts revision numbers, symbols
      "base", "head", a new symbol "current" representing the
      current migration, as well as relative ranges for one
      side at a time (i.e. ``-r-5:head``, ``-rcurrent:+3``).
      Courtesy Atsushi Odagiri for this feature.

    .. change::
      :tags: feature
      :tickets: 55

      Source base is now in-place for Python 2.6 through
      3.3, without the need for 2to3.   Support for Python 2.5
      and below has been dropped.   Huge thanks to
      Hong Minhee for all the effort on this!

.. changelog::
    :version: 0.5.0
    :released: Thu Apr 4 2013

    .. note::

      Alembic 0.5.0 now requires at least
      version 0.7.3 of SQLAlchemy to run properly.
      Support for 0.6 has been dropped.

    .. change::
        :tags: feature
        :tickets: 76

      Added ``version_table_schema`` argument
      to :meth:`.EnvironmentContext.configure`,
      complements the ``version_table`` argument to
      set an optional remote schema for the version
      table.  Courtesy Christian Blume.

    .. change::
        :tags: bug, postgresql
        :tickets: 32

      Fixed format of RENAME for table that includes
      schema with Postgresql; the schema name shouldn't
      be in the "TO" field.

    .. change::
        :tags: feature
        :tickets: 90

      Added ``output_encoding`` option to
      :meth:`.EnvironmentContext.configure`,
      used with ``--sql`` mode to apply an encoding
      to the output stream.

    .. change::
        :tags: feature
        :tickets: 93

      Added :meth:`.Operations.create_primary_key`
      operation, will genenerate an ADD CONSTRAINT
      for a primary key.

    .. change::
        :tags: bug, mssql
        :tickets: 109

      Fixed bug whereby double quoting would be applied
      to target column name during an ``sp_rename``
      operation.

    .. change::
        :tags: bug, sqlite, mysql
        :tickets: 112

      transactional_ddl flag for SQLite, MySQL dialects
      set to False.  MySQL doesn't support it,
      SQLite does but current pysqlite driver does not.

    .. change::
        :tags: feature
        :tickets: 115

      upgrade and downgrade commands will list the
      first line of the docstring out next to the
      version number.  Courtesy Hong Minhee.

    .. change::
        :tags: feature

      Added --head-only option to "alembic current",
      will print current version plus the symbol
      "(head)" if this version is the head or not.
      Courtesy Charles-Axel Dein.

    .. change::
        :tags: bug
        :tickets: 110

      Autogenerate will render additional table keyword
      arguments like "mysql_engine" and others within
      op.create_table().

    .. change::
        :tags: feature
        :tickets: 108

      The rendering of any construct during autogenerate
      can be customized, in particular to allow special rendering
      for user-defined column, constraint subclasses, using new
      ``render_item`` argument to
      :meth:`.EnvironmentContext.configure`.

    .. change::
        :tags: bug

      Fixed bug whereby create_index()
      would include in the constraint columns that
      are added to all Table objects using events,
      externally to the generation of the constraint.
      This is the same issue that was fixed for unique
      constraints in version 0.3.2.

    .. change::
        :tags: bug

      Worked around a backwards-incompatible regression in Python3.3
      regarding argparse; running "alembic" with no arguments
      now yields an informative error in py3.3 as with all previous versions.
      Courtesy Andrey Antukh.

    .. change::
        :tags: change

      SQLAlchemy 0.6 is no longer supported by Alembic - minimum version is 0.7.3,
      full support is as of 0.7.9.

    .. change::
        :tags: bug
        :tickets: 104

      A host of argument name changes within migration
      operations for consistency.  Keyword arguments
      will continue to work on the old name for backwards compatibility,
      however required positional arguments will not:

        :meth:`.Operations.alter_column` - ``name`` -> ``new_column_name`` - old
        name will work for backwards compatibility.

        :meth:`.Operations.create_index` - ``tablename`` -> ``table_name`` -
        argument is positional.

        :meth:`.Operations.drop_index` - ``tablename`` -> ``table_name`` - old
        name will work for backwards compatibility.

        :meth:`.Operations.drop_constraint` - ``tablename`` -> ``table_name`` -
        argument is positional.

        :meth:`.Operations.drop_constraint` - ``type`` -> ``type_`` - old
        name will work for backwards compatibility

.. changelog::
    :version: 0.4.2
    :released: Fri Jan 11 2013

    .. change::
        :tags: bug, autogenerate
        :tickets: 99

      Fixed bug where autogenerate would fail if a Column
      to be added to a table made use of the ".key" parameter.

    .. change::
        :tags: bug, sqlite
        :tickets: 98

      The "implicit" constraint generated by a
      type such as Boolean or Enum will not generate an
      ALTER statement when run on SQlite, which does not
      support ALTER for the purpose of adding/removing
      constraints separate from the column def itself.
      While SQLite supports adding a CHECK constraint
      at the column level, SQLAlchemy would need modification
      to support this.
      A warning is emitted indicating this
      constraint cannot be added in this scenario.

    .. change::
        :tags: bug
        :tickets: 96

      Added a workaround to setup.py to prevent
      "NoneType" error from occurring when
      "setup.py test" is run.

    .. change::
        :tags: bug
        :tickets: 96

      Added an append_constraint() step to each
      condition within
      test_autogenerate:AutogenRenderTest.test_render_fk_constraint_kwarg
      if the SQLAlchemy version is less than 0.8, as ForeignKeyConstraint
      does not auto-append prior to 0.8.

    .. change::
        :tags: feature
        :tickets: 96

      Added a README.unittests with instructions for running the test
      suite fully.

.. changelog::
    :version: 0.4.1
    :released: Sun Dec 9 2012

    .. change::
        :tags: bug
        :tickets: 92

      Added support for autogenerate render of
      ForeignKeyConstraint options onupdate,
      ondelete, initially, and deferred.

    .. change::
        :tags: bug
        :tickets: 94

      Autogenerate will include "autoincrement=False"
      in the rendered table metadata
      if this flag was set to false on the source
      :class:`.Column` object.

    .. change::
        :tags: feature
        :tickets: 66

      Explicit error message describing the case
      when downgrade --sql is used without specifying
      specific start/end versions.

    .. change::
        :tags: bug
        :tickets: 81

      Removed erroneous "emit_events" attribute
      from operations.create_table() documentation.

    .. change::
        :tags: bug
        :tickets:

      Fixed the minute component in file_template
      which returned the month part of the create date.

.. changelog::
    :version: 0.4.0
    :released: Mon Oct 01 2012

    .. change::
        :tags: feature
        :tickets: 33

      Support for tables in alternate schemas
      has been added fully to all operations, as well as to
      the autogenerate feature.  When using autogenerate,
      specifying the flag include_schemas=True to
      Environment.configure() will also cause autogenerate
      to scan all schemas located by Inspector.get_schema_names(),
      which is supported by *some* (but not all)
      SQLAlchemy dialects including Postgresql.
      *Enormous* thanks to Bruno Binet for a huge effort
      in implementing as well as writing tests. .

    .. change::
        :tags: feature
        :tickets: 70

      The command line runner has been organized
      into a reusable CommandLine object, so that other
      front-ends can re-use the argument parsing built
      in.

    .. change::
        :tags: feature
        :tickets: 43

      Added "stdout" option to Config, provides
      control over where the "print" output of commands like
      "history", "init", "current" etc. are sent.

    .. change::
        :tags: bug
        :tickets: 71

      Fixed the "multidb" template which was badly out
      of date.   It now generates revision files using
      the configuration to determine the different
      upgrade_<xyz>() methods needed as well, instead of
      needing to hardcode these.  Huge thanks to
      BryceLohr for doing the heavy lifting here.

    .. change::
        :tags: bug
        :tickets: 72

      Fixed the regexp that was checking for .py files
      in the version directory to allow any .py file through.
      Previously it was doing some kind of defensive checking,
      probably from some early notions of how this directory
      works, that was prohibiting various filename patterns
      such as those which begin with numbers.

    .. change::
        :tags: bug
        :tickets:

      Fixed MySQL rendering for server_default which
      didn't work if the server_default was a generated
      SQL expression.  Courtesy Moriyoshi Koizumi.

    .. change::
        :tags: feature
        :tickets:

      Added support for alteration of MySQL
      columns that have AUTO_INCREMENT, as well as enabling
      this flag.  Courtesy Moriyoshi Koizumi.




.. changelog::
    :version: 0.3.6
    :released: Wed Aug 15 2012

    .. change::
        :tags: feature
        :tickets: 27

      Added include_symbol option to
      EnvironmentContext.configure(),
      specifies a callable which will include/exclude tables
      in their entirety from the autogeneration process
      based on name.

    .. change::
        :tags: feature
        :tickets: 59

      Added year, month, day, hour, minute, second
      variables to file_template.

    .. change::
        :tags: feature
        :tickets:

      Added 'primary' to the list of constraint types
      recognized for MySQL drop_constraint().

    .. change::
        :tags: feature
        :tickets:

      Added --sql argument to the "revision" command,
      for the use case where the "revision_environment"
      config option is being used but SQL access isn't
      desired.

    .. change::
        :tags: bug
        :tickets:

      Repaired create_foreign_key() for
      self-referential foreign keys, which weren't working
      at all.

    .. change::
        :tags: bug
        :tickets: 63

      'alembic' command reports an informative
      error message when the configuration is missing
      the 'script_directory' key.

    .. change::
        :tags: bug
        :tickets: 62

      Fixes made to the constraints created/dropped
      alongside so-called "schema" types such as
      Boolean and Enum.  The create/drop constraint logic
      does not kick in when using a dialect that doesn't
      use constraints for these types, such as postgresql,
      even when existing_type is specified to
      alter_column().  Additionally, the constraints
      are not affected if existing_type is passed but
      type\_ is not, i.e. there's no net change
      in type.

    .. change::
        :tags: bug
        :tickets: 66

      Improved error message when specifying
      non-ordered revision identifiers to cover
      the case when the "higher" rev is None,
      improved message overall.

.. changelog::
    :version: 0.3.5
    :released: Sun Jul 08 2012

    .. change::
        :tags: bug
        :tickets: 31

      Fixed issue whereby reflected server defaults
      wouldn't be quoted correctly; uses repr() now.

    .. change::
        :tags: bug
        :tickets: 58

      Fixed issue whereby when autogenerate would
      render create_table() on the upgrade side for a
      table that has a Boolean type, an unnecessary
      CheckConstraint() would be generated.

    .. change::
        :tags: feature
        :tickets:

      Implemented SQL rendering for
      CheckConstraint() within autogenerate upgrade,
      including for literal SQL as well as SQL Expression
      Language expressions.

.. changelog::
    :version: 0.3.4
    :released: Sat Jun 02 2012

    .. change::
        :tags: bug
        :tickets:

      Fixed command-line bug introduced by the
      "revision_environment" feature.

.. changelog::
    :version: 0.3.3
    :released: Sat Jun 02 2012

    .. change::
        :tags: feature
        :tickets:

      New config argument
      "revision_environment=true", causes env.py to
      be run unconditionally when the "revision" command
      is run, to support script.py.mako templates with
      dependencies on custom "template_args".

    .. change::
        :tags: feature
        :tickets:

      Added "template_args" option to configure()
      so that an env.py can add additional arguments
      to the template context when running the
      "revision" command.  This requires either --autogenerate
      or the configuration directive "revision_environment=true".

    .. change::
        :tags: bug
        :tickets: 44

      Added "type" argument to op.drop_constraint(),
      and implemented full constraint drop support for
      MySQL.  CHECK and undefined raise an error.
      MySQL needs the constraint type
      in order to emit a DROP CONSTRAINT.

    .. change::
        :tags: feature
        :tickets: 34

      Added version_table argument to
      EnvironmentContext.configure(), allowing for the
      configuration of the version table name.

    .. change::
        :tags: feature
        :tickets:

      Added support for "relative" migration
      identifiers, i.e. "alembic upgrade +2",
      "alembic downgrade -1".  Courtesy
      Atsushi Odagiri for this feature.

    .. change::
        :tags: bug
        :tickets: 49

      Fixed bug whereby directories inside of
      the template directories, such as __pycache__
      on Pypy, would mistakenly be interpreted as
      files which are part of the template.

.. changelog::
    :version: 0.3.2
    :released: Mon Apr 30 2012

    .. change::
        :tags: feature
        :tickets: 40

      Basic support for Oracle added,
      courtesy shgoh.

    .. change::
        :tags: feature
        :tickets:

      Added support for UniqueConstraint
      in autogenerate, courtesy Atsushi Odagiri

    .. change::
        :tags: bug
        :tickets:

      Fixed support of schema-qualified
      ForeignKey target in column alter operations,
      courtesy Alexander Kolov.

    .. change::
        :tags: bug
        :tickets:

      Fixed bug whereby create_unique_constraint()
      would include in the constraint columns that
      are added to all Table objects using events,
      externally to the generation of the constraint.

.. changelog::
    :version: 0.3.1
    :released: Sat Apr 07 2012

    .. change::
        :tags: bug
        :tickets: 41

      bulk_insert() fixes:

        1. bulk_insert() operation was
           not working most likely since the 0.2 series
           when used with an engine.
        2. Repaired bulk_insert() to complete when
           used against a lower-case-t table and executing
           with only one set of parameters, working
           around SQLAlchemy bug #2461 in this regard.
        3. bulk_insert() uses "inline=True" so that phrases
           like RETURNING and such don't get invoked for
           single-row bulk inserts.
        4. bulk_insert() will check that you're passing
           a list of dictionaries in, raises TypeError
           if not detected.

.. changelog::
    :version: 0.3.0
    :released: Thu Apr 05 2012

    .. change::
        :tags: general
        :tickets:

      The focus of 0.3 is to clean up
      and more fully document the public API of Alembic,
      including better accessors on the MigrationContext
      and ScriptDirectory objects.  Methods that are
      not considered to be public on these objects have
      been underscored, and methods which should be public
      have been cleaned up and documented, including:

        MigrationContext.get_current_revision()
        ScriptDirectory.iterate_revisions()
        ScriptDirectory.get_current_head()
        ScriptDirectory.get_heads()
        ScriptDirectory.get_base()
        ScriptDirectory.generate_revision()

    .. change::
        :tags: feature
        :tickets:

      Added a bit of autogenerate to the
      public API in the form of the function
      alembic.autogenerate.compare_metadata.




.. changelog::
    :version: 0.2.2
    :released: Mon Mar 12 2012

    .. change::
        :tags: feature
        :tickets:

      Informative error message when op.XYZ
      directives are invoked at module import time.

    .. change::
        :tags: bug
        :tickets: 35

      Fixed inappropriate direct call to
      util.err() and therefore sys.exit()
      when Config failed to locate the
      config file within library usage.

    .. change::
        :tags: bug
        :tickets:

      Autogenerate will emit CREATE TABLE
      and DROP TABLE directives according to
      foreign key dependency order.

    .. change::
        :tags: bug
        :tickets:

      implement 'tablename' parameter on
      drop_index() as this is needed by some
      backends.

    .. change::
        :tags: feature
        :tickets:

      Added execution_options parameter
      to op.execute(), will call execution_options()
      on the Connection before executing.

      The immediate use case here is to allow
      access to the new no_parameters option
      in SQLAlchemy 0.7.6, which allows
      some DBAPIs (psycopg2, MySQLdb) to allow
      percent signs straight through without
      escaping, thus providing cross-compatible
      operation with DBAPI execution and
      static script generation.

    .. change::
        :tags: bug
        :tickets:

      setup.py won't install argparse if on
      Python 2.7/3.2

    .. change::
        :tags: feature
        :tickets: 29

      script_location can be interpreted
      by pkg_resources.resource_filename(), if
      it is a non-absolute URI that contains
      colons.   This scheme is the same
      one used by Pyramid.

    .. change::
        :tags: feature
        :tickets:

      added missing support for
      onupdate/ondelete flags for
      ForeignKeyConstraint, courtesy Giacomo Bagnoli

    .. change::
        :tags: bug
        :tickets: 30

      fixed a regression regarding an autogenerate
      error message, as well as various glitches
      in the Pylons sample template.  The Pylons sample
      template requires that you tell it where to
      get the Engine from now.  courtesy
      Marcin Kuzminski

    .. change::
        :tags: bug
        :tickets:

      drop_index() ensures a dummy column
      is added when it calls "Index", as SQLAlchemy
      0.7.6 will warn on index with no column names.

.. changelog::
    :version: 0.2.1
    :released: Tue Jan 31 2012

    .. change::
        :tags: bug
        :tickets: 26

      Fixed the generation of CHECK constraint,
      regression from 0.2.0

.. changelog::
    :version: 0.2.0
    :released: Mon Jan 30 2012

    .. change::
        :tags: feature
        :tickets: 19

      API rearrangement allows everything
      Alembic does to be represented by contextual
      objects, including EnvironmentContext,
      MigrationContext, and Operations.   Other
      libraries and applications can now use
      things like "alembic.op" without relying
      upon global configuration variables.
      The rearrangement was done such that
      existing migrations should be OK,
      as long as they use the pattern
      of "from alembic import context" and
      "from alembic import op", as these
      are now contextual objects, not modules.

    .. change::
        :tags: feature
        :tickets: 24

      The naming of revision files can
      now be customized to be some combination
      of "rev id" and "slug", the latter of which
      is based on the revision message.
      By default, the pattern "<rev>_<slug>"
      is used for new files.   New script files
      should include the "revision" variable
      for this to work, which is part of
      the newer script.py.mako scripts.

    .. change::
        :tags: bug
        :tickets: 25

      env.py templates call
      connection.close() to better support
      programmatic usage of commands; use
      NullPool in conjunction with create_engine()
      as well so that no connection resources
      remain afterwards.

    .. change::
        :tags: bug
        :tickets: 22

      fix the config.main() function to honor
      the arguments passed, remove no longer used
      "scripts/alembic" as setuptools creates this
      for us.

    .. change::
        :tags: bug
        :tickets:

      Fixed alteration of column type on
      MSSQL to not include the keyword "TYPE".

    .. change::
        :tags: feature
        :tickets: 23

      Can create alembic.config.Config
      with no filename, use set_main_option()
      to add values.  Also added set_section_option()
      which will add sections.




.. changelog::
    :version: 0.1.1
    :released: Wed Jan 04 2012

    .. change::
        :tags: bug
        :tickets:

      Clean up file write operations so that
      file handles are closed.

    .. change::
        :tags: feature
        :tickets:

      PyPy is supported.

    .. change::
        :tags: feature
        :tickets:

      Python 2.5 is supported, needs
      __future__.with_statement

    .. change::
        :tags: bug
        :tickets:

      Fix autogenerate so that "pass" is
      generated between the two comments
      if no net migrations were present.

    .. change::
        :tags: bug
        :tickets: 16

      Fix autogenerate bug that prevented
      correct reflection of a foreign-key
      referenced table in the list of "to remove".

    .. change::
        :tags: bug
        :tickets: 17

      Fix bug where create_table() didn't
      handle self-referential foreign key
      correctly

    .. change::
        :tags: bug
        :tickets: 18

      Default prefix for autogenerate
      directives is "op.", matching the
      mako templates.

    .. change::
        :tags: feature
        :tickets: 18

      Add alembic_module_prefix argument
      to configure() to complement
      sqlalchemy_module_prefix.

    .. change::
        :tags: bug
        :tickets: 14

      fix quotes not being rendered in
      ForeignKeConstraint during
      autogenerate

.. changelog::
    :version: 0.1.0
    :released: Wed Nov 30 2011

    .. change::
        :tags:
        :tickets:

      Initial release.  Status of features:

    .. change::
        :tags:
        :tickets:

      Alembic is used in at least one production
      environment, but should still be considered
      ALPHA LEVEL SOFTWARE as of this release,
      particularly in that many features are expected
      to be missing / unimplemented.   Major API
      changes are not anticipated but for the moment
      nothing should be assumed.

      The author asks that you *please* report all
      issues, missing features, workarounds etc.
      to the bugtracker.

    .. change::
        :tags:
        :tickets:

      Python 3 is supported and has been tested.

    .. change::
        :tags:
        :tickets:

      The "Pylons" and "MultiDB" environment templates
      have not been directly tested - these should be
      considered to be samples to be modified as
      needed.   Multiple database support itself
      is well tested, however.

    .. change::
        :tags:
        :tickets:

      Postgresql and MS SQL Server environments
      have been tested for several weeks in a production
      environment.  In particular, some involved workarounds
      were implemented to allow fully-automated dropping
      of default- or constraint-holding columns with
      SQL Server.

    .. change::
        :tags:
        :tickets:

      MySQL support has also been implemented to a
      basic degree, including MySQL's awkward style
      of modifying columns being accommodated.

    .. change::
        :tags:
        :tickets:

      Other database environments not included among
      those three have *not* been tested, *at all*.  This
      includes Firebird, Oracle, Sybase.   Adding
      support for these backends should be
      straightforward.  Please report all missing/
      incorrect behaviors to the bugtracker! Patches
      are welcome here but are optional - please just
      indicate the exact format expected by the target
      database.

    .. change::
        :tags:
        :tickets:

      SQLite, as a backend, has almost no support for
      schema alterations to existing databases.  The author
      would strongly recommend that SQLite not be used in
      a migration context - just dump your SQLite database
      into an intermediary format, then dump it back
      into a new schema.  For dev environments, the
      dev installer should be building the whole DB from
      scratch.  Or just use Postgresql, which is a much
      better database for non-trivial schemas.
      Requests for full ALTER support on SQLite should be
      reported to SQLite's bug tracker at
      http://www.sqlite.org/src/wiki?name=Bug+Reports,
      as Alembic will not be implementing the
      "rename the table to a temptable then copy the
      data into a new table" workaround.
      Note that Alembic will at some point offer an
      extensible API so that you can implement commands
      like this yourself.

    .. change::
        :tags:
        :tickets:

      Well-tested directives include add/drop table, add/drop
      column, including support for SQLAlchemy "schema"
      types which generate additional CHECK
      constraints, i.e. Boolean, Enum.  Other directives not
      included here have *not* been strongly tested
      in production, i.e. rename table, etc.

    .. change::
        :tags:
        :tickets:

      Both "online" and "offline" migrations, the latter
      being generated SQL scripts to hand off to a DBA,
      have been strongly production tested against
      Postgresql and SQL Server.

    .. change::
        :tags:
        :tickets:

      Modify column type, default status, nullable, is
      functional and tested across PG, MSSQL, MySQL,
      but not yet widely tested in production usage.

    .. change::
        :tags:
        :tickets:

      Many migrations are still outright missing, i.e.
      create/add sequences, etc.  As a workaround,
      execute() can be used for those which are missing,
      though posting of tickets for new features/missing
      behaviors is strongly encouraged.

    .. change::
        :tags:
        :tickets:

      Autogenerate feature is implemented and has been
      tested, though only a little bit in a production setting.
      In particular, detection of type and server
      default changes are optional and are off by default;
      they can also be customized by a callable.
      Both features work but can have surprises particularly
      the disparity between BIT/TINYINT and boolean,
      which hasn't yet been worked around, as well as
      format changes performed by the database on defaults
      when it reports back.  When enabled, the PG dialect
      will execute the two defaults to be compared to
      see if they are equivalent.  Other backends may
      need to do the same thing.

      The autogenerate feature only generates
      "candidate" commands which must be hand-tailored
      in any case, so is still a useful feature and
      is safe to use.  Please report missing/broken features
      of autogenerate!  This will be a great feature and
      will also improve SQLAlchemy's reflection services.

    .. change::
        :tags:
        :tickets:

      Support for non-ASCII table, column and constraint
      names is mostly nonexistent.   This is also a
      straightforward feature add as SQLAlchemy itself
      supports unicode identifiers; Alembic itself will
      likely need fixes to logging, column identification
      by key, etc. for full support here.