blob: cfdad49f4826b44c474889e16aeb28b21afb7fbd [file] [log] [blame]
Matthias Andreas Benkardba3e58c2020-11-01 12:58:35 +01001<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2<databaseChangeLog
3 xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5 xsi:schemaLocation="
6 http://www.liquibase.org/xml/ns/dbchangelog
7 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.10.xsd">
8
9 <changeSet author="mulk" id="1.7-1">
10 <createTable tableName="newsletters" schemaName="benki">
11 <column name="id" type="INTEGER">
12 <constraints primaryKeyName="newsletters_pkey" nullable="false" primaryKey="true"/>
13 </column>
14
15 <column name="date" type="TIMESTAMP WITH TIME ZONE">
16 <constraints nullable="false"/>
17 </column>
18 </createTable>
19
20 <addColumn tableName="bookmarks" schemaName="benki">
21 <column name="newsletter" type="INTEGER">
22 <constraints foreignKeyName="bookmarks_newsletter_fkey" references="benki.newsletters(id)"/>
23 </column>
24 </addColumn>
25
26 <addColumn tableName="lazychat_messages" schemaName="benki">
27 <column name="newsletter" type="INTEGER">
28 <constraints foreignKeyName="lazychat_messages_newsletter_fkey" references="benki.newsletters(id)"/>
29 </column>
30 </addColumn>
31
32 <addColumn tableName="posts" schemaName="benki">
33 <column name="newsletter" type="INTEGER">
34 <constraints foreignKeyName="posts_newsletter_fkey" references="benki.newsletters(id)"/>
35 </column>
36 </addColumn>
37 </changeSet>
38
39 <changeSet author="mulk" id="1.7-2">
40 <createTable tableName="newsletter_subscriptions" schemaName="benki">
41 <column name="id" type="SERIAL" autoIncrement="true">
42 <constraints primaryKeyName="newsletter_subscriptions_pkey" nullable="false" primaryKey="true"/>
43 </column>
44
45 <column name="start_date" type="TIMESTAMP WITH TIME ZONE" defaultValue="now()">
46 <constraints nullable="false"/>
47 </column>
48
49 <column name="email" type="VARCHAR">
50 <constraints nullable="false" unique="true" uniqueConstraintName="newsletter_subscriptions_email_key"/>
51 </column>
52 </createTable>
53 </changeSet>
54
Matthias Andreas Benkardff358942020-11-03 06:16:17 +010055 <changeSet author="mulk" id="1.7-3">
56 <addColumn tableName="newsletter_subscriptions" schemaName="benki">
57 <column name="registration_key" type="VARCHAR">
58 <constraints unique="true" uniqueConstraintName="newsletter_subscriptions_registration_key_key"/>
59 </column>
60 </addColumn>
61
62 <createIndex tableName="newsletter_subscriptions"
63 schemaName="benki"
64 indexName="newsletter_subscriptions_registration_key_idx">
65 <column name="registration_key"/>
66 </createIndex>
67 </changeSet>
68
Matthias Andreas Benkardba3e58c2020-11-01 12:58:35 +010069</databaseChangeLog>