// Copyright 2026 Moko Consulting <hello@mokoconsulting.tech>
// SPDX-License-Identifier: GPL-3.0-or-later

package v1_27

import (
	"xorm.io/xorm"
)

// AddRepoManifestTable creates the repo_manifest table for storing
// mokoplatform manifest settings per repository.
func AddRepoManifestTable(x *xorm.Engine) error {
	type RepoManifest struct {
		ID               int64  `xorm:"pk autoincr"`
		RepoID           int64  `xorm:"UNIQUE INDEX NOT NULL 'repo_id'"`
		Name             string `xorm:"TEXT 'name'"`
		Org              string `xorm:"TEXT 'org'"`
		Description      string `xorm:"TEXT 'description'"`
		Version          string `xorm:"TEXT 'version'"`
		LicenseSPDX      string `xorm:"VARCHAR(50) 'license_spdx'"`
		LicenseName      string `xorm:"TEXT 'license_name'"`
		Platform         string `xorm:"VARCHAR(50) 'platform'"`
		StandardsVersion string `xorm:"VARCHAR(20) 'standards_version'"`
		StandardsSource  string `xorm:"TEXT 'standards_source'"`
		Language         string `xorm:"VARCHAR(50) 'language'"`
		PackageType      string `xorm:"VARCHAR(50) 'package_type'"`
		EntryPoint       string `xorm:"TEXT 'entry_point'"`
		CreatedUnix      int64  `xorm:"INDEX CREATED 'created_unix'"`
		UpdatedUnix      int64  `xorm:"UPDATED 'updated_unix'"`
	}
	return x.Sync(new(RepoManifest))
}
