<?php namespace App\Models;

use CodeIgniter\Model;

class GitRepositoriesModel extends Model
{
	protected $table = 'git_repositories';
	protected $primaryKey = 'id';
	protected $useAutoIncrement = true;
	protected $returnType = 'array';
	protected $useSoftDeletes = false;
	protected $protectFields = true;
	protected $allowedFields = [
		'gitea_repo_id',
		'owner_user_id',
		'owner_username',
		'name',
		'full_name',
		'description',
		'html_url',
		'clone_url',
		'default_branch',
		'is_private',
		'is_archived',
		'is_fork',
		'open_issues_count',
		'stars_count',
		'forks_count',
		'watchers_count',
		'last_pushed_at',
		'last_synced_at',
	];

	protected $useTimestamps = true;
	protected $dateFormat = 'datetime';
	protected $createdField = 'created_at';
	protected $updatedField = 'updated_at';
}
