// Copyright 2022 Dolthub, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

table WorkingSet {
  // 20-byte hashes of root values.
  working_root_addr:[ubyte] (required);
  staged_root_addr:[ubyte];

  // Meta
  name:string (required);
  email:string (required);
  desc:string (required);
  timestamp_millis:uint64;

  merge_state:MergeState;
}

table MergeState {
  // An address for the the working root value before the merge started.
  pre_working_root_addr:[ubyte] (required);

  // The commit that we are merging.
  from_commit_addr:[ubyte] (required);

  // The spec that was used to identify the commit that we are merging. Optional
  // for backwards compatibility.
  from_commit_spec_str:string;

  unmergable_tables:[string];
}

// KEEP THIS IN SYNC WITH fileidentifiers.go
file_identifier "WRST";

root_type WorkingSet;
