@earbug/db-models 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.env ADDED
@@ -0,0 +1,5 @@
1
+ PG_HOST=localhost
2
+ PG_PORT=6432
3
+ PG_USER=postgres
4
+ PG_PASSWORD=
5
+ PG_DATABASE=earbug_live
@@ -7,10 +7,11 @@ export interface AppUserDeviceAttributes {
7
7
  appUserId: string;
8
8
  devicePlatformId: number;
9
9
  endpointArn: string;
10
+ platformApplicationArn?: string;
10
11
  }
11
12
  export type AppUserDevicePk = "id";
12
13
  export type AppUserDeviceId = AppUserDevice[AppUserDevicePk];
13
- export type AppUserDeviceOptionalAttributes = "id" | "createdAt";
14
+ export type AppUserDeviceOptionalAttributes = "id" | "createdAt" | "platformApplicationArn";
14
15
  export type AppUserDeviceCreationAttributes = Optional<AppUserDeviceAttributes, AppUserDeviceOptionalAttributes>;
15
16
  export declare class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceCreationAttributes> implements AppUserDeviceAttributes {
16
17
  id: string;
@@ -18,6 +19,7 @@ export declare class AppUserDevice extends Model<AppUserDeviceAttributes, AppUse
18
19
  appUserId: string;
19
20
  devicePlatformId: number;
20
21
  endpointArn: string;
22
+ platformApplicationArn?: string;
21
23
  appUser: AppUser;
22
24
  getAppUser: Sequelize.BelongsToGetAssociationMixin<AppUser>;
23
25
  setAppUser: Sequelize.BelongsToSetAssociationMixin<AppUser, AppUserId>;
@@ -60,6 +60,11 @@ class AppUserDevice extends sequelize_1.Model {
60
60
  allowNull: false,
61
61
  unique: "unique_app_user_device_endpoint_arn",
62
62
  field: 'endpoint_arn'
63
+ },
64
+ platformApplicationArn: {
65
+ type: sequelize_1.DataTypes.TEXT,
66
+ allowNull: true,
67
+ field: 'platform_application_arn'
63
68
  }
64
69
  }, {
65
70
  sequelize,
@@ -18,10 +18,12 @@ export interface CanonArtistAttributes {
18
18
  hasThumbnailPhoto?: boolean;
19
19
  images?: object;
20
20
  lastImageHarvestAttempt?: Date;
21
+ merchHarvestDay?: number;
22
+ newsHarvestDay?: number;
21
23
  }
22
24
  export type CanonArtistPk = "id";
23
25
  export type CanonArtistId = CanonArtist[CanonArtistPk];
24
- export type CanonArtistOptionalAttributes = "description" | "id" | "createDate" | "updateDate" | "hasThumbnailPhoto" | "images" | "lastImageHarvestAttempt";
26
+ export type CanonArtistOptionalAttributes = "description" | "id" | "createDate" | "updateDate" | "hasThumbnailPhoto" | "images" | "lastImageHarvestAttempt" | "merchHarvestDay" | "newsHarvestDay";
25
27
  export type CanonArtistCreationAttributes = Optional<CanonArtistAttributes, CanonArtistOptionalAttributes>;
26
28
  export declare class CanonArtist extends Model<CanonArtistAttributes, CanonArtistCreationAttributes> implements CanonArtistAttributes {
27
29
  name: string;
@@ -34,6 +36,8 @@ export declare class CanonArtist extends Model<CanonArtistAttributes, CanonArtis
34
36
  hasThumbnailPhoto?: boolean;
35
37
  images?: object;
36
38
  lastImageHarvestAttempt?: Date;
39
+ merchHarvestDay?: number;
40
+ newsHarvestDay?: number;
37
41
  canonArtistAlbumRelations: CanonArtistAlbumRelation[];
38
42
  getCanonArtistAlbumRelations: Sequelize.HasManyGetAssociationsMixin<CanonArtistAlbumRelation>;
39
43
  setCanonArtistAlbumRelations: Sequelize.HasManySetAssociationsMixin<CanonArtistAlbumRelation, CanonArtistAlbumRelationId>;
@@ -80,6 +80,16 @@ class CanonArtist extends sequelize_1.Model {
80
80
  type: sequelize_1.DataTypes.DATE,
81
81
  allowNull: true,
82
82
  field: 'last_image_harvest_attempt'
83
+ },
84
+ merchHarvestDay: {
85
+ type: sequelize_1.DataTypes.NUMBER,
86
+ allowNull: true,
87
+ field: 'merch_harvest_day'
88
+ },
89
+ newsHarvestDay: {
90
+ type: sequelize_1.DataTypes.NUMBER,
91
+ allowNull: true,
92
+ field: 'news_harvest_day'
83
93
  }
84
94
  }, {
85
95
  sequelize,
@@ -0,0 +1,41 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model, Optional } from 'sequelize';
3
+ import type { CanonArtist, CanonArtistId } from './CanonArtist';
4
+ import type { NewsPlatform, NewsPlatformId } from './NewsPlatform';
5
+ export interface NewsArticleAttributes {
6
+ id: string;
7
+ canonArtistId: string;
8
+ newsPlatformId: string;
9
+ title: string;
10
+ description: string;
11
+ articleUrl: string;
12
+ photoUrl: string;
13
+ articlePublishDate: Date;
14
+ createDate: Date;
15
+ updateDate: Date;
16
+ }
17
+ export type NewsArticlePk = "id";
18
+ export type NewsArticleId = NewsArticle[NewsArticlePk];
19
+ export type NewsArticleOptionalAttributes = "id" | "articlePublishDate" | "createDate" | "updateDate";
20
+ export type NewsArticleCreationAttributes = Optional<NewsArticleAttributes, NewsArticleOptionalAttributes>;
21
+ export declare class NewsArticle extends Model<NewsArticleAttributes, NewsArticleCreationAttributes> implements NewsArticleAttributes {
22
+ id: string;
23
+ canonArtistId: string;
24
+ newsPlatformId: string;
25
+ title: string;
26
+ description: string;
27
+ articleUrl: string;
28
+ photoUrl: string;
29
+ articlePublishDate: Date;
30
+ createDate: Date;
31
+ updateDate: Date;
32
+ canonArtist: CanonArtist;
33
+ getCanonArtist: Sequelize.BelongsToGetAssociationMixin<CanonArtist>;
34
+ setCanonArtist: Sequelize.BelongsToSetAssociationMixin<CanonArtist, CanonArtistId>;
35
+ createCanonArtist: Sequelize.BelongsToCreateAssociationMixin<CanonArtist>;
36
+ newsPlatform: NewsPlatform;
37
+ getNewsPlatform: Sequelize.BelongsToGetAssociationMixin<NewsPlatform>;
38
+ setNewsPlatform: Sequelize.BelongsToSetAssociationMixin<NewsPlatform, NewsPlatformId>;
39
+ createNewsPlatform: Sequelize.BelongsToCreateAssociationMixin<NewsPlatform>;
40
+ static initModel(sequelize: Sequelize.Sequelize): typeof NewsArticle;
41
+ }
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.NewsArticle = void 0;
27
+ const Sequelize = __importStar(require("sequelize"));
28
+ const sequelize_1 = require("sequelize");
29
+ class NewsArticle extends sequelize_1.Model {
30
+ static initModel(sequelize) {
31
+ return NewsArticle.init({
32
+ id: {
33
+ type: sequelize_1.DataTypes.UUID,
34
+ allowNull: false,
35
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v4'),
36
+ primaryKey: true
37
+ },
38
+ canonArtistId: {
39
+ type: sequelize_1.DataTypes.UUID,
40
+ allowNull: false,
41
+ references: {
42
+ model: 'canon_artist',
43
+ key: 'id'
44
+ },
45
+ field: 'canon_artist_id'
46
+ },
47
+ newsPlatformId: {
48
+ type: sequelize_1.DataTypes.UUID,
49
+ allowNull: false,
50
+ references: {
51
+ model: 'news_platform',
52
+ key: 'id'
53
+ },
54
+ field: 'news_platform_id'
55
+ },
56
+ title: {
57
+ type: sequelize_1.DataTypes.CITEXT,
58
+ allowNull: false
59
+ },
60
+ description: {
61
+ type: sequelize_1.DataTypes.CITEXT,
62
+ allowNull: false
63
+ },
64
+ articleUrl: {
65
+ type: sequelize_1.DataTypes.CITEXT,
66
+ allowNull: false,
67
+ field: 'article_url'
68
+ },
69
+ photoUrl: {
70
+ type: sequelize_1.DataTypes.CITEXT,
71
+ allowNull: false,
72
+ field: 'photo_url'
73
+ },
74
+ articlePublishDate: {
75
+ type: sequelize_1.DataTypes.DATE,
76
+ allowNull: false,
77
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
78
+ field: 'article_publish_date'
79
+ },
80
+ createDate: {
81
+ type: sequelize_1.DataTypes.DATE,
82
+ allowNull: false,
83
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
84
+ field: 'create_date'
85
+ },
86
+ updateDate: {
87
+ type: sequelize_1.DataTypes.DATE,
88
+ allowNull: false,
89
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
90
+ field: 'update_date'
91
+ }
92
+ }, {
93
+ sequelize,
94
+ tableName: 'news_article',
95
+ schema: 'eb',
96
+ timestamps: false,
97
+ indexes: [
98
+ {
99
+ name: "news_article_pkey",
100
+ unique: true,
101
+ fields: [
102
+ { name: "id" },
103
+ ]
104
+ },
105
+ ]
106
+ });
107
+ }
108
+ }
109
+ exports.NewsArticle = NewsArticle;
@@ -0,0 +1,31 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model, Optional } from 'sequelize';
3
+ import type { NewsArticle, NewsArticleId } from './NewsArticle';
4
+ export interface NewsPlatformAttributes {
5
+ id: string;
6
+ name: string;
7
+ createDate: Date;
8
+ updateDate: Date;
9
+ }
10
+ export type NewsPlatformPk = "id";
11
+ export type NewsPlatformId = NewsPlatform[NewsPlatformPk];
12
+ export type NewsPlatformOptionalAttributes = "id" | "createDate" | "updateDate";
13
+ export type NewsPlatformCreationAttributes = Optional<NewsPlatformAttributes, NewsPlatformOptionalAttributes>;
14
+ export declare class NewsPlatform extends Model<NewsPlatformAttributes, NewsPlatformCreationAttributes> implements NewsPlatformAttributes {
15
+ id: string;
16
+ name: string;
17
+ createDate: Date;
18
+ updateDate: Date;
19
+ newsArticles: NewsArticle[];
20
+ getNewsArticles: Sequelize.HasManyGetAssociationsMixin<NewsArticle>;
21
+ setNewsArticles: Sequelize.HasManySetAssociationsMixin<NewsArticle, NewsArticleId>;
22
+ addNewsArticle: Sequelize.HasManyAddAssociationMixin<NewsArticle, NewsArticleId>;
23
+ addNewsArticles: Sequelize.HasManyAddAssociationsMixin<NewsArticle, NewsArticleId>;
24
+ createNewsArticle: Sequelize.HasManyCreateAssociationMixin<NewsArticle>;
25
+ removeNewsArticle: Sequelize.HasManyRemoveAssociationMixin<NewsArticle, NewsArticleId>;
26
+ removeNewsArticles: Sequelize.HasManyRemoveAssociationsMixin<NewsArticle, NewsArticleId>;
27
+ hasNewsArticle: Sequelize.HasManyHasAssociationMixin<NewsArticle, NewsArticleId>;
28
+ hasNewsArticles: Sequelize.HasManyHasAssociationsMixin<NewsArticle, NewsArticleId>;
29
+ countNewsArticles: Sequelize.HasManyCountAssociationsMixin;
30
+ static initModel(sequelize: Sequelize.Sequelize): typeof NewsPlatform;
31
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.NewsPlatform = void 0;
27
+ const Sequelize = __importStar(require("sequelize"));
28
+ const sequelize_1 = require("sequelize");
29
+ class NewsPlatform extends sequelize_1.Model {
30
+ static initModel(sequelize) {
31
+ return NewsPlatform.init({
32
+ id: {
33
+ type: sequelize_1.DataTypes.UUID,
34
+ allowNull: false,
35
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v4'),
36
+ primaryKey: true
37
+ },
38
+ name: {
39
+ type: sequelize_1.DataTypes.CITEXT,
40
+ allowNull: false
41
+ },
42
+ createDate: {
43
+ type: sequelize_1.DataTypes.DATE,
44
+ allowNull: false,
45
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
46
+ field: 'create_date'
47
+ },
48
+ updateDate: {
49
+ type: sequelize_1.DataTypes.DATE,
50
+ allowNull: false,
51
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
52
+ field: 'update_date'
53
+ }
54
+ }, {
55
+ sequelize,
56
+ tableName: 'news_platform',
57
+ schema: 'eb',
58
+ timestamps: false,
59
+ indexes: [
60
+ {
61
+ name: "news_platform_pkey",
62
+ unique: true,
63
+ fields: [
64
+ { name: "id" },
65
+ ]
66
+ },
67
+ ]
68
+ });
69
+ }
70
+ }
71
+ exports.NewsPlatform = NewsPlatform;
@@ -8,11 +8,12 @@ export interface AppUserDeviceAttributes {
8
8
  appUserId: string;
9
9
  devicePlatformId: number;
10
10
  endpointArn: string;
11
+ platformApplicationArn?: string;
11
12
  }
12
13
 
13
14
  export type AppUserDevicePk = "id";
14
15
  export type AppUserDeviceId = AppUserDevice[AppUserDevicePk];
15
- export type AppUserDeviceOptionalAttributes = "id" | "createdAt";
16
+ export type AppUserDeviceOptionalAttributes = "id" | "createdAt" | "platformApplicationArn";
16
17
  export type AppUserDeviceCreationAttributes = Optional<AppUserDeviceAttributes, AppUserDeviceOptionalAttributes>;
17
18
 
18
19
  export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceCreationAttributes> implements AppUserDeviceAttributes {
@@ -21,6 +22,7 @@ export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceC
21
22
  appUserId!: string;
22
23
  devicePlatformId!: number;
23
24
  endpointArn!: string;
25
+ platformApplicationArn?: string;
24
26
 
25
27
  // AppUserDevice belongsTo AppUser via appUserId
26
28
  appUser!: AppUser;
@@ -61,6 +63,11 @@ export class AppUserDevice extends Model<AppUserDeviceAttributes, AppUserDeviceC
61
63
  allowNull: false,
62
64
  unique: "unique_app_user_device_endpoint_arn",
63
65
  field: 'endpoint_arn'
66
+ },
67
+ platformApplicationArn: {
68
+ type: DataTypes.TEXT,
69
+ allowNull: true,
70
+ field: 'platform_application_arn'
64
71
  }
65
72
  }, {
66
73
  sequelize,
@@ -19,11 +19,13 @@ export interface CanonArtistAttributes {
19
19
  hasThumbnailPhoto?: boolean;
20
20
  images?: object;
21
21
  lastImageHarvestAttempt?: Date;
22
+ merchHarvestDay?: number;
23
+ newsHarvestDay?: number;
22
24
  }
23
25
 
24
26
  export type CanonArtistPk = "id";
25
27
  export type CanonArtistId = CanonArtist[CanonArtistPk];
26
- export type CanonArtistOptionalAttributes = "description" | "id" | "createDate" | "updateDate" | "hasThumbnailPhoto" | "images" | "lastImageHarvestAttempt";
28
+ export type CanonArtistOptionalAttributes = "description" | "id" | "createDate" | "updateDate" | "hasThumbnailPhoto" | "images" | "lastImageHarvestAttempt" | "merchHarvestDay" | "newsHarvestDay";
27
29
  export type CanonArtistCreationAttributes = Optional<CanonArtistAttributes, CanonArtistOptionalAttributes>;
28
30
 
29
31
  export class CanonArtist extends Model<CanonArtistAttributes, CanonArtistCreationAttributes> implements CanonArtistAttributes {
@@ -37,6 +39,8 @@ export class CanonArtist extends Model<CanonArtistAttributes, CanonArtistCreatio
37
39
  hasThumbnailPhoto?: boolean;
38
40
  images?: object;
39
41
  lastImageHarvestAttempt?: Date;
42
+ merchHarvestDay?: number;
43
+ newsHarvestDay?: number;
40
44
 
41
45
  // CanonArtist hasMany CanonArtistAlbumRelation via canonArtistId
42
46
  canonArtistAlbumRelations!: CanonArtistAlbumRelation[];
@@ -176,6 +180,16 @@ export class CanonArtist extends Model<CanonArtistAttributes, CanonArtistCreatio
176
180
  type: DataTypes.DATE,
177
181
  allowNull: true,
178
182
  field: 'last_image_harvest_attempt'
183
+ },
184
+ merchHarvestDay: {
185
+ type: DataTypes.NUMBER,
186
+ allowNull: true,
187
+ field: 'merch_harvest_day'
188
+ },
189
+ newsHarvestDay: {
190
+ type: DataTypes.NUMBER,
191
+ allowNull: true,
192
+ field: 'news_harvest_day'
179
193
  }
180
194
  }, {
181
195
  sequelize,
@@ -0,0 +1,126 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { CanonArtist, CanonArtistId } from './CanonArtist';
4
+ import type { NewsPlatform, NewsPlatformId } from './NewsPlatform';
5
+
6
+ export interface NewsArticleAttributes {
7
+ id: string;
8
+ canonArtistId: string;
9
+ newsPlatformId: string;
10
+ title: string;
11
+ description: string;
12
+ articleUrl: string;
13
+ photoUrl: string;
14
+ articlePublishDate: Date;
15
+ createDate: Date;
16
+ updateDate: Date;
17
+ }
18
+
19
+ export type NewsArticlePk = "id";
20
+ export type NewsArticleId = NewsArticle[NewsArticlePk];
21
+ export type NewsArticleOptionalAttributes = "id" | "articlePublishDate" | "createDate" | "updateDate";
22
+ export type NewsArticleCreationAttributes = Optional<NewsArticleAttributes, NewsArticleOptionalAttributes>;
23
+
24
+ export class NewsArticle extends Model<NewsArticleAttributes, NewsArticleCreationAttributes> implements NewsArticleAttributes {
25
+ id!: string;
26
+ canonArtistId!: string;
27
+ newsPlatformId!: string;
28
+ title!: string;
29
+ description!: string;
30
+ articleUrl!: string;
31
+ photoUrl!: string;
32
+ articlePublishDate!: Date;
33
+ createDate!: Date;
34
+ updateDate!: Date;
35
+
36
+ // NewsArticle belongsTo CanonArtist via canonArtistId
37
+ canonArtist!: CanonArtist;
38
+ getCanonArtist!: Sequelize.BelongsToGetAssociationMixin<CanonArtist>;
39
+ setCanonArtist!: Sequelize.BelongsToSetAssociationMixin<CanonArtist, CanonArtistId>;
40
+ createCanonArtist!: Sequelize.BelongsToCreateAssociationMixin<CanonArtist>;
41
+ // NewsArticle belongsTo NewsPlatform via newsPlatformId
42
+ newsPlatform!: NewsPlatform;
43
+ getNewsPlatform!: Sequelize.BelongsToGetAssociationMixin<NewsPlatform>;
44
+ setNewsPlatform!: Sequelize.BelongsToSetAssociationMixin<NewsPlatform, NewsPlatformId>;
45
+ createNewsPlatform!: Sequelize.BelongsToCreateAssociationMixin<NewsPlatform>;
46
+
47
+ static initModel(sequelize: Sequelize.Sequelize): typeof NewsArticle {
48
+ return NewsArticle.init({
49
+ id: {
50
+ type: DataTypes.UUID,
51
+ allowNull: false,
52
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v4'),
53
+ primaryKey: true
54
+ },
55
+ canonArtistId: {
56
+ type: DataTypes.UUID,
57
+ allowNull: false,
58
+ references: {
59
+ model: 'canon_artist',
60
+ key: 'id'
61
+ },
62
+ field: 'canon_artist_id'
63
+ },
64
+ newsPlatformId: {
65
+ type: DataTypes.UUID,
66
+ allowNull: false,
67
+ references: {
68
+ model: 'news_platform',
69
+ key: 'id'
70
+ },
71
+ field: 'news_platform_id'
72
+ },
73
+ title: {
74
+ type: DataTypes.CITEXT,
75
+ allowNull: false
76
+ },
77
+ description: {
78
+ type: DataTypes.CITEXT,
79
+ allowNull: false
80
+ },
81
+ articleUrl: {
82
+ type: DataTypes.CITEXT,
83
+ allowNull: false,
84
+ field: 'article_url'
85
+ },
86
+ photoUrl: {
87
+ type: DataTypes.CITEXT,
88
+ allowNull: false,
89
+ field: 'photo_url'
90
+ },
91
+ articlePublishDate: {
92
+ type: DataTypes.DATE,
93
+ allowNull: false,
94
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
95
+ field: 'article_publish_date'
96
+ },
97
+ createDate: {
98
+ type: DataTypes.DATE,
99
+ allowNull: false,
100
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
101
+ field: 'create_date'
102
+ },
103
+ updateDate: {
104
+ type: DataTypes.DATE,
105
+ allowNull: false,
106
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
107
+ field: 'update_date'
108
+ }
109
+ }, {
110
+ sequelize,
111
+ tableName: 'news_article',
112
+ schema: 'eb',
113
+ timestamps: false,
114
+ indexes: [
115
+ {
116
+ name: "news_article_pkey",
117
+ unique: true,
118
+ fields: [
119
+ { name: "id" },
120
+ ]
121
+ },
122
+ ]
123
+ });
124
+ }
125
+ }
126
+
@@ -0,0 +1,77 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { DataTypes, Model, Optional } from 'sequelize';
3
+ import type { NewsArticle, NewsArticleId } from './NewsArticle';
4
+
5
+ export interface NewsPlatformAttributes {
6
+ id: string;
7
+ name: string;
8
+ createDate: Date;
9
+ updateDate: Date;
10
+ }
11
+
12
+ export type NewsPlatformPk = "id";
13
+ export type NewsPlatformId = NewsPlatform[NewsPlatformPk];
14
+ export type NewsPlatformOptionalAttributes = "id" | "createDate" | "updateDate";
15
+ export type NewsPlatformCreationAttributes = Optional<NewsPlatformAttributes, NewsPlatformOptionalAttributes>;
16
+
17
+ export class NewsPlatform extends Model<NewsPlatformAttributes, NewsPlatformCreationAttributes> implements NewsPlatformAttributes {
18
+ id!: string;
19
+ name!: string;
20
+ createDate!: Date;
21
+ updateDate!: Date;
22
+
23
+ // NewsPlatform hasMany NewsArticle via newsPlatformId
24
+ newsArticles!: NewsArticle[];
25
+ getNewsArticles!: Sequelize.HasManyGetAssociationsMixin<NewsArticle>;
26
+ setNewsArticles!: Sequelize.HasManySetAssociationsMixin<NewsArticle, NewsArticleId>;
27
+ addNewsArticle!: Sequelize.HasManyAddAssociationMixin<NewsArticle, NewsArticleId>;
28
+ addNewsArticles!: Sequelize.HasManyAddAssociationsMixin<NewsArticle, NewsArticleId>;
29
+ createNewsArticle!: Sequelize.HasManyCreateAssociationMixin<NewsArticle>;
30
+ removeNewsArticle!: Sequelize.HasManyRemoveAssociationMixin<NewsArticle, NewsArticleId>;
31
+ removeNewsArticles!: Sequelize.HasManyRemoveAssociationsMixin<NewsArticle, NewsArticleId>;
32
+ hasNewsArticle!: Sequelize.HasManyHasAssociationMixin<NewsArticle, NewsArticleId>;
33
+ hasNewsArticles!: Sequelize.HasManyHasAssociationsMixin<NewsArticle, NewsArticleId>;
34
+ countNewsArticles!: Sequelize.HasManyCountAssociationsMixin;
35
+
36
+ static initModel(sequelize: Sequelize.Sequelize): typeof NewsPlatform {
37
+ return NewsPlatform.init({
38
+ id: {
39
+ type: DataTypes.UUID,
40
+ allowNull: false,
41
+ defaultValue: Sequelize.Sequelize.fn('uuid_generate_v4'),
42
+ primaryKey: true
43
+ },
44
+ name: {
45
+ type: DataTypes.CITEXT,
46
+ allowNull: false
47
+ },
48
+ createDate: {
49
+ type: DataTypes.DATE,
50
+ allowNull: false,
51
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
52
+ field: 'create_date'
53
+ },
54
+ updateDate: {
55
+ type: DataTypes.DATE,
56
+ allowNull: false,
57
+ defaultValue: Sequelize.Sequelize.literal('CURRENT_TIMESTAMP'),
58
+ field: 'update_date'
59
+ }
60
+ }, {
61
+ sequelize,
62
+ tableName: 'news_platform',
63
+ schema: 'eb',
64
+ timestamps: false,
65
+ indexes: [
66
+ {
67
+ name: "news_platform_pkey",
68
+ unique: true,
69
+ fields: [
70
+ { name: "id" },
71
+ ]
72
+ },
73
+ ]
74
+ });
75
+ }
76
+ }
77
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@earbug/db-models",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "main": "dist/init-models.js",
5
5
  "types": "dist/init-models.d.ts",
6
6
  "scripts": {