@speakr/speakr-module-services
Version:
SPEAKR Shared Service Module
199 lines (195 loc) • 3.99 kB
JavaScript
/**
* Created by Lorenzo on 10/11/16.
*/
'use strict';
let _ = require('underscore');
module.exports = function(sequelize, DataTypes) {
let campaign_profiles = sequelize.define('campaign_profiles', {
id_hash: {
type: DataTypes.STRING,
allowNull: true
},
campaign_id: {
type: DataTypes.INTEGER,
allowNull: true
},
project_name: {
type: DataTypes.TEXT,
allowNull: true
},
date: {
type: DataTypes.DATE
},
products: {
type: DataTypes.STRING
},
age_high: {
type: DataTypes.INTEGER
},
age_low: {
type: DataTypes.INTEGER
},
gender: {
type: DataTypes.STRING
},
country: {
type: DataTypes.JSON,
defaultValue: [],
field:'countries_json'
},
content_rating: {
type: DataTypes.STRING
},
promo_explanation: {
type: DataTypes.TEXT
},
linked_asset: {
type: DataTypes.TEXT
},
simultaneous_campaigns: {
type: DataTypes.JSON,
field: 'simultaneous_campaigns_json'
},
brand_safety: {
type: DataTypes.TEXT
},
product_price: {
type: DataTypes.INTEGER
},
added_value: {
type: DataTypes.INTEGER
},
total_cost: {
type: DataTypes.INTEGER
},
start_date: {
type: DataTypes.DATE
},
end_date: {
type: DataTypes.DATE
},
cpm: {
type: DataTypes.FLOAT
},
impressions: {
type: DataTypes.INTEGER,
field: 'final_impressions'
},
inventory_type: {
type: DataTypes.STRING
},
category: {
type: DataTypes.STRING
},
other_interests: {
type: DataTypes.STRING
},
audience_age_high: {
type: DataTypes.INTEGER
},
audience_age_low: {
type: DataTypes.INTEGER
},
audience_country: {
type: DataTypes.JSON,
defaultValue: [],
field: 'audience_countries_json'
},
audience_content_rating: {
type: DataTypes.STRING
},
audience_gender: {
type: DataTypes.STRING
},
cities: {
type: DataTypes.JSON,
defaultValue: [],
field: 'cities_json'
},
states: {
type: DataTypes.JSON,
defaultValue: [],
field: 'states_json'
},
audience_cities: {
type: DataTypes.JSON,
defaultValue: [],
field: 'audience_cities_json'
},
audience_states: {
type: DataTypes.JSON,
defaultValue: [],
field: 'audience_states_json'
},
audience_interests: {
type: DataTypes.STRING
},
gender_skew: {
type: DataTypes.STRING
},
audience_gender_skew: {
type: DataTypes.STRING
},
whitelisting: {
type: DataTypes.BOOLEAN
},
premium: {
type: DataTypes.BOOLEAN
},
ethnicities: {
type: DataTypes.HSTORE
},
audience_ethnicities: {
type: DataTypes.HSTORE
},
speakr_contacts: {
type: DataTypes.JSON,
defaultValue: []
},
agency_contacts: {
type: DataTypes.JSON,
defaultValue: []
},
content_categories: {
type: DataTypes.HSTORE
},
platforms: {
type: DataTypes.HSTORE
},
account_categories: {
type: DataTypes.HSTORE
},
content_tone: {
type: DataTypes.HSTORE
},
other_characteristics: {
type: DataTypes.TEXT
},
expectations_goals: {
type: DataTypes.TEXT
},
assets_links: {
type: DataTypes.ARRAY(DataTypes.STRING)
},
assets_images: {
type: DataTypes.ARRAY(DataTypes.STRING)
},
assets_files: {
type: DataTypes.ARRAY(DataTypes.STRING)
},
hashtags: {
type: DataTypes.JSON,
field: 'hashtags_json'
},
keywords_to_avoid: {
type: DataTypes.JSON,
field: 'keywords_to_avoid_json'
},
approval_requirements: {
type: DataTypes.HSTORE,
field: 'approval_requirements_hstore'
}
}, {
});
return campaign_profiles;
};