mistercrunch commented on code in PR #26654:
URL: https://github.com/apache/superset/pull/26654#discussion_r1458114598


##########
superset/migrations/__init__.py:
##########
@@ -14,3 +14,10 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+
+import os
+import sys
+
+# hack to be able to import / reuse migration_utils.py in revisions
+module_dir = os.path.dirname(os.path.realpath(__file__))

Review Comment:
   This is a bit of a breakthrough, I tried before to get some sort of 
`migration_utils.py` module going to reuse code across revisions, and never was 
able to do it. Here's the hack that enables it. This is great because 
constraint handling and such get verbose if done right, and all the 
dialect-specific stuff shouldn't be repeated in each revision. Hoping we can 
grow `migration_utils` in the future to simplify and improve revisions. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to