File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/main/resources/liquibase/version/0.3 Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 18
18
<comment >Sets value of slug field to transformed collection's owner's name</comment >
19
19
20
20
<!-- Unfortunately, H2 doesn't support UPDATE with JOIN -->
21
- <sql >
21
+ <sql dbms = " mysql,h2 " >
22
22
UPDATE collections c
23
23
SET c.slug = (
24
24
SELECT LOWER(REPLACE(u.login, ' ', '-'))
27
27
);
28
28
</sql >
29
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
+
30
40
</changeSet >
31
41
32
42
<changeSet id =" make-slug-field-not-nullable" author =" php-coder" context =" scheme" >
You can’t perform that action at this time.
0 commit comments