<commit_before>var rethink       = require( 'thinky' )({db:'tastypie'})
  , type          = rethink.type
  , User
  , Tag
  , Power


Tag = rethink.createModel('tastypie_tag',{
  user_id:type.string()
},{
  pk:'name'
})


Post = rethink.createModel('tastypie_post',{
    title: type.string()
    ,user_id:type.string()
},{
    pk:'post_id'
});

var Company = rethink.createModel('tastypie_company',{
    name: type.string(),
    user_id: type.string(),
    address:{
        state: type.string(),
        city: type.string(),
        street: type.string(),
        country: type.string()
    }
})


User =  rethink.createModel('tastypie_user',{
	index:      type.number()
  , guid:       type.string()
  , isActive:   type.boolean().default(false)
  , balance:    type.string()
  , picture:    type.string()
  , age:        type.number()
  , eyeColor:   type.string()
  , date:       type.date()
  , name:       type.string()
 /*
    , company:    {
  	name:type.string()
  	,address:{
  		city:type.string(),
  		state:type.string(),
  		street:type.string(),
  		country:type.string()
  	}
  }
*/
  , email:      type.string()
  , phone:      type.string()
  , address:    type.string()
  , about:      type.string()
  , registered: type.date()
  , latitude:   type.number()
  , longitude:  type.number()
  , range:      [type.number()]
  , friends:    [{name:type.string(), id:type.number() }]
});




User.r = rethink.r

User.hasOne( Company, 'company','id','user_id')
User.hasMany(Tag, 'tags', 'id', 'user_id');
User.hasMany(Post, 'posts', 'id', 'user_id');

module.exports = User;
module.exports.Tag = Tag
module.exports.Company = Company;
module.exports.Post = Post;<commit_msg>adding a shoe Model for m2m testing<commit_after>var rethink       = require( 'thinky' )({db:'tastypie'})
  , type          = rethink.type
  , User
  , Tag
  , Post
  , Shoe


Tag = rethink.createModel('tastypie_tag',{
  user_id:type.string()
},{
  pk:'name'
})


Shoe = rethink.createModel('tastypie_shoe',{
	brand:type.string().required()
	,color:type.string().required()
	,size: type.number().min(1).max(20).required().default( 1 )
},{
	pk:'shoe_id'
});

Post = rethink.createModel('tastypie_post',{
    title: type.string()
    ,user_id:type.string()
},{
    pk:'post_id'
});

var Company = rethink.createModel('tastypie_company',{
    name: type.string(),
    user_id: type.string(),
    address:{
        state: type.string(),
        city: type.string(),
        street: type.string(),
        country: type.string()
    }
})


User =  rethink.createModel('tastypie_user',{
	index:      type.number()
  , guid:       type.string()
  , isActive:   type.boolean().default(false)
  , balance:    type.string()
  , picture:    type.string()
  , age:        type.number()
  , eyeColor:   type.string()
  , date:       type.date()
  , name:       type.string()
 /*
    , company:    {
  	name:type.string()
  	,address:{
  		city:type.string(),
  		state:type.string(),
  		street:type.string(),
  		country:type.string()
  	}
  }
*/
  , email:      type.string()
  , phone:      type.string()
  , address:    type.string()
  , about:      type.string()
  , registered: type.date()
  , latitude:   type.number()
  , longitude:  type.number()
  , range:      [type.number()]
  , friends:    [{name:type.string(), id:type.number() }]
});




User.r = rethink.r

User.hasOne( Company, 'company','id','user_id')
User.hasMany(Tag, 'tags', 'id', 'user_id');
User.hasMany(Post, 'posts', 'id', 'user_id');

User.hasAndBelongsToMany(Shoe,'shoes', 'id','shoe_id');

module.exports = User;
module.exports.Tag = Tag
module.exports.Company = Company;
module.exports.Post = Post;
module.exports.Shoe = Shoe;
{'fraction_non_alphanumeric': 0.18646371296547976, 'fraction_numerical': 0.001359064963305246, 'mean_word_length': 2.961248654467169, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1025388', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1339, 'n_words': 224}