We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c03b2cc commit 6d296fdCopy full SHA for 6d296fd
src/main/resources/liquibase/version/0.3/2014-09-28--collection_slug.xml
@@ -18,7 +18,7 @@
18
<comment>Sets value of slug field to transformed collection's owner's name</comment>
19
20
<!-- Unfortunately, H2 doesn't support UPDATE with JOIN -->
21
- <sql>
+ <sql dbms="mysql,h2">
22
UPDATE collections c
23
SET c.slug = (
24
SELECT LOWER(REPLACE(u.login, ' ', '-'))
@@ -27,6 +27,16 @@
27
);
28
</sql>
29
30
+ <!-- In PostgreSQL it is illegal to prefix columns with table alias in the SET clause -->
31
+ <sql dbms="postgresql">
32
+ UPDATE collections c
33
+ SET slug = (
34
+ SELECT LOWER(REPLACE(u.login, ' ', '-'))
35
+ FROM users u
36
+ WHERE u.id = c.user_id
37
+ );
38
+ </sql>
39
+
40
</changeSet>
41
42
<changeSet id="make-slug-field-not-nullable" author="php-coder" context="scheme">
0 commit comments